feat: move from upstash to redis
Some checks failed
Deploy / lint-build-deploy (push) Failing after 2m35s
Some checks failed
Deploy / lint-build-deploy (push) Failing after 2m35s
This commit is contained in:
@@ -11,15 +11,16 @@ export async function GET(req: Request) {
|
||||
return NextResponse.json({ error: 'No key provided' }, { status: 400 });
|
||||
}
|
||||
|
||||
const state = await redis.get(key);
|
||||
const rawState = await redis.get(key);
|
||||
|
||||
if (!state) {
|
||||
if (!rawState) {
|
||||
return NextResponse.json(
|
||||
{ error: 'No data found for this key' },
|
||||
{ status: 404 }
|
||||
);
|
||||
}
|
||||
|
||||
const state = JSON.parse(rawState);
|
||||
const validatedState = validateState(state);
|
||||
return NextResponse.json({ data: validatedState });
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user