From 6f85c8d91b146878964a31ce1396028c003043d8 Mon Sep 17 00:00:00 2001 From: Brett Slaski Date: Tue, 3 Oct 2023 13:10:20 -0500 Subject: [PATCH] fix: edit activity not found or no permissions to it --- package.json | 2 +- src/routes/activities/edit/+layout.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index d21c674ae..20ee291d0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "that-us", - "version": "3.13.5", + "version": "3.13.6", "description": "THAT.us website", "main": "index.js", "type": "module", diff --git a/src/routes/activities/edit/+layout.js b/src/routes/activities/edit/+layout.js index 4ce42969b..0c89307eb 100644 --- a/src/routes/activities/edit/+layout.js +++ b/src/routes/activities/edit/+layout.js @@ -2,6 +2,7 @@ import dayjs from 'dayjs'; import isSameOrBefore from 'dayjs/plugin/isSameOrBefore.js'; import isBetween from 'dayjs/plugin/isBetween.js'; import lodash from 'lodash'; +import { error } from '@sveltejs/kit'; import eventsApi from '$dataSources/api.that.tech/events/queries'; import sessionsQueryApi from '$dataSources/api.that.tech/sessions/queries'; @@ -47,6 +48,12 @@ export const load = auth0.withPageAuthRequired({ queryEventsByCommunity() ]); + if (!activityDetails) { + throw new error(404, { + message: 'Activity Not Found' + }); + } + return { activityDetails, events,