mirror of
https://github.com/jcreek/LivingDexTracker.git
synced 2026-07-12 18:43:45 +00:00
refactor(#89): Address PR comments
This commit is contained in:
@@ -48,9 +48,14 @@ export const PUT = async (event: RequestEvent) => {
|
|||||||
.is('pokedexId', null)
|
.is('pokedexId', null)
|
||||||
.eq('provider', provider)
|
.eq('provider', provider)
|
||||||
.select('id, provider, enabled, fileName, folderId, path, metadata, lastExportedAt, lastError')
|
.select('id, provider, enabled, fileName, folderId, path, metadata, lastExportedAt, lastError')
|
||||||
.single();
|
.maybeSingle();
|
||||||
|
|
||||||
if (error || !data) {
|
if (error) {
|
||||||
|
console.error(error);
|
||||||
|
return json({ error: 'Internal Server Error' }, { status: 500 });
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data === null) {
|
||||||
return json({ error: 'Integration not found' }, { status: 404 });
|
return json({ error: 'Integration not found' }, { status: 404 });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export const GET = async (event: RequestEvent) => {
|
|||||||
if (!clientId) {
|
if (!clientId) {
|
||||||
const missingClientRedirect = pokedexId
|
const missingClientRedirect = pokedexId
|
||||||
? `/pokedex/${pokedexId}?export=google-missing-client`
|
? `/pokedex/${pokedexId}?export=google-missing-client`
|
||||||
: '/pokedex?export=google-missing-client';
|
: '/backup-settings?export=google-missing-client';
|
||||||
throw redirect(302, missingClientRedirect);
|
throw redirect(302, missingClientRedirect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user