Skip to content

Commit

Permalink
fix: edit activity not found or no permissions to it
Browse files Browse the repository at this point in the history
  • Loading branch information
brettski committed Oct 3, 2023
1 parent bcd6844 commit 6f85c8d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "that-us",
"version": "3.13.5",
"version": "3.13.6",
"description": "THAT.us website",
"main": "index.js",
"type": "module",
Expand Down
7 changes: 7 additions & 0 deletions src/routes/activities/edit/+layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -47,6 +48,12 @@ export const load = auth0.withPageAuthRequired({
queryEventsByCommunity()
]);

if (!activityDetails) {
throw new error(404, {
message: 'Activity Not Found'
});
}

return {
activityDetails,
events,
Expand Down

0 comments on commit 6f85c8d

Please sign in to comment.