Small reviews page changes

This commit is contained in:
orosmatthew 2023-04-28 16:06:51 -04:00
parent 596db398e7
commit 676b771122
2 changed files with 5 additions and 4 deletions

View File

@ -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',

View File

@ -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>