feat(04-01): update thread service, routes, and hooks for categoryId
- createThread now inserts categoryId from data - getAllThreads joins categories table, returns categoryName/categoryEmoji - updateThread accepts optional categoryId - ThreadListItem interface includes category fields - useCreateThread hook sends categoryId - Fix test files to pass categoryId when creating threads Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,9 @@ interface ThreadListItem {
|
||||
name: string;
|
||||
status: "active" | "resolved";
|
||||
resolvedCandidateId: number | null;
|
||||
categoryId: number;
|
||||
categoryName: string;
|
||||
categoryEmoji: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
candidateCount: number;
|
||||
@@ -60,7 +63,7 @@ export function useThread(threadId: number | null) {
|
||||
export function useCreateThread() {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation({
|
||||
mutationFn: (data: { name: string }) =>
|
||||
mutationFn: (data: { name: string; categoryId: number }) =>
|
||||
apiPost<ThreadListItem>("/api/threads", data),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ["threads"] });
|
||||
|
||||
Reference in New Issue
Block a user