mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-11 05:06:39 +00:00
Add endpoints
This commit is contained in:
21
server/routers/global/site/createSite.ts
Normal file
21
server/routers/global/site/createSite.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { Request, Response, NextFunction } from 'express';
|
||||
import response from "@server/utils/response";
|
||||
import HttpCode from '@server/types/HttpCode';
|
||||
|
||||
interface CreateSiteRequest {
|
||||
publicKey: string;
|
||||
name: string;
|
||||
orgId: number;
|
||||
}
|
||||
|
||||
export async function createSite(req: Request, res: Response, next: NextFunction) {
|
||||
return res.status(HttpCode.OK).send(
|
||||
response<null>({
|
||||
data: null,
|
||||
success: true,
|
||||
error: false,
|
||||
message: "Logged in successfully",
|
||||
status: HttpCode.OK,
|
||||
}),
|
||||
);
|
||||
}
|
||||
19
server/routers/global/site/deleteSite.ts
Normal file
19
server/routers/global/site/deleteSite.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { Request, Response, NextFunction } from 'express';
|
||||
import response from "@server/utils/response";
|
||||
import HttpCode from '@server/types/HttpCode';
|
||||
|
||||
interface DeleteSiteRequest {
|
||||
siteId: string;
|
||||
}
|
||||
|
||||
export async function deleteSite(req: Request, res: Response, next: NextFunction) {
|
||||
return res.status(HttpCode.OK).send(
|
||||
response<null>({
|
||||
data: null,
|
||||
success: true,
|
||||
error: false,
|
||||
message: "Logged in successfully",
|
||||
status: HttpCode.OK,
|
||||
}),
|
||||
);
|
||||
}
|
||||
15
server/routers/global/site/getSite.ts
Normal file
15
server/routers/global/site/getSite.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Request, Response, NextFunction } from 'express';
|
||||
import response from "@server/utils/response";
|
||||
import HttpCode from '@server/types/HttpCode';
|
||||
|
||||
export async function getSite(req: Request, res: Response, next: NextFunction) {
|
||||
return res.status(HttpCode.OK).send(
|
||||
response<null>({
|
||||
data: null,
|
||||
success: true,
|
||||
error: false,
|
||||
message: "Logged in successfully",
|
||||
status: HttpCode.OK,
|
||||
}),
|
||||
);
|
||||
}
|
||||
15
server/routers/global/site/updateSite.ts
Normal file
15
server/routers/global/site/updateSite.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Request, Response, NextFunction } from 'express';
|
||||
import response from "@server/utils/response";
|
||||
import HttpCode from '@server/types/HttpCode';
|
||||
|
||||
export async function updateSite(req: Request, res: Response, next: NextFunction) {
|
||||
return res.status(HttpCode.OK).send(
|
||||
response<null>({
|
||||
data: null,
|
||||
success: true,
|
||||
error: false,
|
||||
message: "Logged in successfully",
|
||||
status: HttpCode.OK,
|
||||
}),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user