mirror of
https://github.com/usatiuk/photos.git
synced 2025-10-28 23:37:48 +01:00
15 lines
491 B
TypeScript
15 lines
491 B
TypeScript
import * as Router from "@koa/router";
|
|
import { Photo } from "~entity/Photo";
|
|
import { User } from "~entity/User";
|
|
import { IAppContext, IAppState } from "~app";
|
|
|
|
export const devRouter = new Router<IAppState, IAppContext>();
|
|
|
|
type ContextType = Parameters<Parameters<(typeof devRouter)["post"]>["2"]>["0"];
|
|
|
|
devRouter.get("/dev/clean", async (ctx: ContextType) => {
|
|
await Photo.remove(await Photo.find());
|
|
await User.remove(await User.find());
|
|
ctx.body = { success: true };
|
|
});
|