2 Commits

Author SHA1 Message Date
schreifuchs 60ff74f233 chore: add pipeline
Commit / ci (push) Successful in 40s
2025-11-26 22:12:42 +01:00
schreifuchs 5ab04b9acb feat: mvp 2025-11-26 21:48:06 +01:00
2 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -26,4 +26,4 @@ jobs:
context: .
file: ./Dockerfile
push: true
tags: 'git.schreifuchs.ch/schreifuchs/aktiteil:${{ github.ref_name }},git.schreifuchs.ch/schreifuchs/aktiteil:latest'
tags: 'git.schreifuchs.ch/schreifuchs/aktiteil:${{ github.ref_name }},git.schreifuchs.ch/aktiteil/tdontd:latest'
+6 -6
View File
@@ -1,7 +1,7 @@
import { db } from '$lib/server/db';
import { aktis, ratings } from '$lib/server/db/schema';
import { error, redirect, type Actions } from '@sveltejs/kit';
import { and, eq } from 'drizzle-orm';
import { eq } from 'drizzle-orm';
import type { PageServerLoad } from './$types';
import { ensureAuth } from '$lib/auth';
import { extractFormData } from '$lib/extractFormData';
@@ -56,11 +56,11 @@ export const actions = {
if (!changeRequest) return error(400);
await db
.update(aktis)
.set({ ...changeRequest, version: akti[0].version + 1 })
.where(and(eq(aktis.author, user.id), eq(aktis.id, event.params.aktiId)));
const res = await db
.insert(aktis)
.values({ ...changeRequest, author: user.id, version: akti[0].version + 1 })
.returning({ id: aktis.id });
return redirect(303, resolve(`/akti/[aktiId]`, { aktiId: event.params.aktiId }));
return redirect(303, resolve(`/akti/[aktiId]`, { aktiId: res[0].id }));
}
} satisfies Actions;