Small reviews page changes
This commit is contained in:
parent
596db398e7
commit
676b771122
@ -1,7 +1,6 @@
|
|||||||
import { z } from 'zod';
|
|
||||||
import type { PageServerLoad } from './$types';
|
import type { PageServerLoad } from './$types';
|
||||||
import * as Diff from 'diff';
|
import * as Diff from 'diff';
|
||||||
import { error } from '@sveltejs/kit';
|
import { error, redirect } from '@sveltejs/kit';
|
||||||
import { db } from '$lib/server/prisma';
|
import { db } from '$lib/server/prisma';
|
||||||
|
|
||||||
export const load = (async ({ params }) => {
|
export const load = (async ({ params }) => {
|
||||||
@ -11,7 +10,7 @@ export const load = (async ({ params }) => {
|
|||||||
}
|
}
|
||||||
const submission = await db.submission.findUnique({ where: { id: submissionId } });
|
const submission = await db.submission.findUnique({ where: { id: submissionId } });
|
||||||
if (!submission) {
|
if (!submission) {
|
||||||
throw error(400, 'Invalid submission');
|
throw redirect(302, '/admin/reviews');
|
||||||
}
|
}
|
||||||
let diff = Diff.createTwoFilesPatch(
|
let diff = Diff.createTwoFilesPatch(
|
||||||
'expected',
|
'expected',
|
||||||
|
@ -42,6 +42,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row justify-content-end">
|
<div class="row justify-content-end">
|
||||||
<button type="submit" class="mt-3 col-1 btn btn-secondary">Submit</button>
|
<div class="text-end">
|
||||||
|
<button type="submit" class="mt-3 btn btn-secondary">Submit</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
Loading…
Reference in New Issue
Block a user