Skip to content

Commit 5e25e78

Browse files
committed
looks good to me
1 parent 21f7679 commit 5e25e78

File tree

8 files changed

+51
-2
lines changed

8 files changed

+51
-2
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
types/database.types.ts linguist-generated
File renamed without changes.

eslint.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
import ts from '@typed-sigterm/eslint-config';
22

3-
export default ts();
3+
export default ts({
4+
ignores: [
5+
'./app/types/database.types.ts',
6+
],
7+
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"preview": "nuxt preview",
88
"postinstall": "nuxt prepare",
99
"push-db": "supabase db push --db-url $SUPABASE_DATABASE_URL",
10-
"gen-types": "supabase gen types --db-url $SUPABASE_DATABASE_URL --lang typescript > ./types/database.types.ts",
10+
"gen-types": "supabase gen types --db-url $SUPABASE_DATABASE_URL --lang typescript > ./app/types/database.types.ts",
1111
"type-check": "nuxt typecheck"
1212
},
1313
"devDependencies": {

server/api/request-tasks.post.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { serverSupabaseClient, serverSupabaseUser } from '#supabase/server';
2+
import { z } from 'zod';
3+
4+
const Body = z.object({
5+
id: z.string(),
6+
});
7+
8+
export default defineEventHandler(async (ev) => {
9+
const body = await readValidatedBody(ev, Body.parse);
10+
// const user = await serverSupabaseUser(ev);
11+
const supa = await serverSupabaseClient(ev);
12+
13+
const taskOwner = await supa
14+
.from('tasks')
15+
.select('*')
16+
.eq('id', body.id)
17+
.single();
18+
19+
if (taskOwner.error) {
20+
console.error('Error querying task owner:', taskOwner.error);
21+
throw createError({ status: 500, message: 'Failed to query task owner' });
22+
}
23+
24+
// todo
25+
});

server/tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "../.nuxt/tsconfig.server.json"
3+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE public.tasks
2+
ADD COLUMN requesting_tasks boolean DEFAULT false;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
ALTER TABLE public.topics
2+
DROP CONSTRAINT fk_topics_owner,
3+
ADD CONSTRAINT fk_topics_owner FOREIGN KEY (owner)
4+
REFERENCES auth.users (id) ON DELETE CASCADE;
5+
6+
ALTER TABLE public.timeline_nodes
7+
DROP CONSTRAINT fk_topic_timeline_nodes,
8+
ADD CONSTRAINT fk_topic_timeline_nodes FOREIGN KEY (topic_id)
9+
REFERENCES public.topics (id) ON DELETE CASCADE;
10+
11+
ALTER TABLE public.tasks
12+
DROP CONSTRAINT fk_topic_tasks,
13+
ADD CONSTRAINT fk_topic_tasks FOREIGN KEY (topic_id)
14+
REFERENCES public.topics (id) ON DELETE CASCADE;

0 commit comments

Comments
 (0)