Skip to content

Commit

Permalink
Revrt "Update eslint and add dlete event sql qry"
Browse files Browse the repository at this point in the history
This reverts commit 3515d89.
  • Loading branch information
Draikth committed Jul 25, 2024
1 parent 682071c commit a25f93a
Show file tree
Hide file tree
Showing 3 changed files with 161 additions and 115 deletions.
17 changes: 0 additions & 17 deletions database/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,6 @@ export const getEvent = cache(async (sessionToken: string, eventId: number) => {
return event;
});

export const deleteEvent = cache(
async (sessionToken: string, eventId: number) => {
const [event] = await sql<SiteEvent[]>`
DELETE FROM events USING sessions
WHERE
events.user_id = sessions.user_id
AND events.id = ${eventId}
AND sessions.token = ${sessionToken}
AND sessions.expiry_timestamp > now()
RETURNING
events.*
`;

return event;
},
);

export const getEventsInsecure = cache(async () => {
const events = await sql<SiteEvent[]>`
SELECT
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@types/node": "^20.14.10",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"eslint-config-upleveled": "^8.6.13",
"eslint-config-upleveled": "^8.6.3",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"libpg-query": "^16.2.0",
Expand Down
Loading

0 comments on commit a25f93a

Please sign in to comment.