Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(datalabeling): cope fix for no caching #257

Merged
merged 1 commit into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions frontend/app/api/ext/label/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { NextRequest, NextResponse } from "next/server";
import clientPromise from '@/lib/mongodb';
import { ObjectId } from "mongodb";
import dynamic from "next/dynamic";
export const fetchCache = 'force-no-store';

type Data = {
success: boolean;
Expand Down Expand Up @@ -59,7 +60,7 @@ export async function POST(request: NextRequest) {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type',
'Cache-Control': 'no-store, max-age=0',
'Cache-Control': 'no-store, no-store, must-revalidate, max-age=0',
},
status: 200
});
Expand All @@ -70,7 +71,7 @@ export async function POST(request: NextRequest) {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type',
'Cache-Control': 'no-store, max-age=0',
'Cache-Control': 'no-store, no-store, must-revalidate, max-age=0',
},
status: 400
});
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/api/ext/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export async function GET(request: NextRequest) {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type',
'Cache-Control': 'no-store, max-age=0',
'Cache-Control': 'no-store, no-store, must-revalidate, max-age=0',
}
});
} catch (error) {
Expand All @@ -54,7 +54,7 @@ export async function GET(request: NextRequest) {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type',
'Cache-Control': 'no-store, max-age=0',
'Cache-Control': 'no-store, no-store, must-revalidate, max-age=0',
}
});
}
Expand Down
5 changes: 3 additions & 2 deletions frontend/app/api/ext/stats/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { NextRequest } from "next/server";
import clientPromise from '@/lib/mongodb';
import dynamic from "next/dynamic";
export const fetchCache = 'force-no-store';

type Data = {
success: boolean;
Expand Down Expand Up @@ -66,7 +67,7 @@ export async function GET(request: NextRequest) {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type',
'Cache-Control': 'no-store, max-age=0',
'Cache-Control': 'no-store, no-store, must-revalidate, max-age=0',
}
});
} catch (error) {
Expand All @@ -76,7 +77,7 @@ export async function GET(request: NextRequest) {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type',
'Cache-Control': 'no-store, max-age=0',
'Cache-Control': 'no-store, no-store, must-revalidate, max-age=0',
}
});
}
Expand Down
Loading