Skip to content

Commit 9b6c8cf

Browse files
committed
Fix attempt no. 2, fix bug
1 parent 52415b9 commit 9b6c8cf

8 files changed

Lines changed: 32 additions & 12 deletions

File tree

app/api/admin/sources/proposals/count/route.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { hasPermission } from "@/types";
44
import { getServerSession } from "next-auth/next";
55
import { cacheTag } from "next/cache";
66

7+
export const dynamic = "force-dynamic";
8+
79
async function fetchProposalsCount() {
810
"use cache";
911
cacheTag("source-proposals-count");

app/api/admin/sources/proposals/get/route.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { pool } from "@/lib/db";
44
import { authOptions } from "@/lib/security/auth";
55
import { hasPermission, SourceProposal } from "@/types";
66

7+
export const dynamic = "force-dynamic";
8+
79
export async function GET() {
810
const session = await getServerSession(authOptions);
911

app/api/getLocations/route.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
import { fetchLocations } from "@/lib/db";
22

3+
export const dynamic = "force-dynamic";
4+
35
export async function GET() {
46
const locations = await fetchLocations();
5-
7+
68
return new Response(
79
JSON.stringify(locations),
8-
{ headers: {
9-
'Content-Type': 'application/json'
10-
}}
10+
{
11+
headers: {
12+
'Content-Type': 'application/json'
13+
}
14+
}
1115
);
1216
}
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
import { fetchSourceCategories } from "@/lib/db";
22

3+
export const dynamic = "force-dynamic";
4+
35
export async function GET() {
46
const categories = await fetchSourceCategories();
5-
7+
68
return new Response(
79
JSON.stringify(categories),
8-
{ headers: {
9-
'Content-Type': 'application/json'
10-
}}
10+
{
11+
headers: {
12+
'Content-Type': 'application/json'
13+
}
14+
}
1115
);
1216
}

app/api/getSourceTags/route.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
import { fetchSourceTags } from "@/lib/db";
22

3+
export const dynamic = "force-dynamic";
4+
35
export async function GET() {
46
const tags = await fetchSourceTags();
57

68
return new Response(
79
JSON.stringify(tags),
8-
{ headers: {
9-
'Content-Type': 'application/json'
10-
}}
10+
{
11+
headers: {
12+
'Content-Type': 'application/json'
13+
}
14+
}
1115
);
1216
}

app/api/getSourcesEN/route.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { fetchDisplaySourcesEN } from "@/lib/db";
22

3+
export const dynamic = "force-dynamic";
4+
35
export async function GET() {
46
const locations = await fetchDisplaySourcesEN();
57

app/api/getSourcesLT/route.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { fetchDisplaySourcesLT } from "@/lib/db";
22

3+
export const dynamic = "force-dynamic";
4+
35
export async function GET() {
46
const locations = await fetchDisplaySourcesLT();
57

lib/eventLog.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ interface LogEventProps {
2929
export async function logEvent({ type, data, userId, sourceId }: LogEventProps): Promise<void> {
3030
try {
3131
await pool.query(
32-
'INSERT INTO event_log (type, data, user_id, source_id) VALUES ($1, $2, $3, $4)',
32+
'INSERT INTO event_log (event_type, event_data, event_related_user, event_related_source) VALUES ($1, $2, $3, $4)',
3333
[type, data, userId, sourceId]
3434
);
3535
} catch (error) {

0 commit comments

Comments
 (0)