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 * as Diff from 'diff';
|
||||
import { error } from '@sveltejs/kit';
|
||||
import { error, redirect } from '@sveltejs/kit';
|
||||
import { db } from '$lib/server/prisma';
|
||||
|
||||
export const load = (async ({ params }) => {
|
||||
@ -11,7 +10,7 @@ export const load = (async ({ params }) => {
|
||||
}
|
||||
const submission = await db.submission.findUnique({ where: { id: submissionId } });
|
||||
if (!submission) {
|
||||
throw error(400, 'Invalid submission');
|
||||
throw redirect(302, '/admin/reviews');
|
||||
}
|
||||
let diff = Diff.createTwoFilesPatch(
|
||||
'expected',
|
||||
|
@ -42,6 +42,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
</form>
|
||||
|
Loading…
Reference in New Issue
Block a user