mirror of
https://github.com/jcreek/LivingDexTracker.git
synced 2026-07-13 11:03:44 +00:00
feat(*): Update seeding logic to handle new fields and record the last modified date
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { json } from '@sveltejs/kit';
|
||||
import { dbConnect, dbDisconnect } from '$lib/utils/db';
|
||||
import PokedexMetadataModel from '$lib/models/PokedexMetadata';
|
||||
|
||||
export const GET = async () => {
|
||||
await dbConnect();
|
||||
|
||||
const metadata = await PokedexMetadataModel.findOne();
|
||||
await dbDisconnect();
|
||||
|
||||
if (metadata) {
|
||||
return json({ lastModified: metadata.lastModified });
|
||||
} else {
|
||||
return json({ message: 'Metadata not found' }, { status: 404 });
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user