mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 06:29:07 +00:00
deffiretiate main and custom edits
This commit is contained in:
@@ -31,6 +31,8 @@ export async function generateUrl(req: Request, res: Response<GetUrl | ErrorResp
|
||||
req.body.baseUrl,
|
||||
req.body.path,
|
||||
req.body.lock,
|
||||
req.body.lockMainFields,
|
||||
req.body.lockCustomFields,
|
||||
req.body.authenticate,
|
||||
);
|
||||
res.status(200).send({ url: url.toString() });
|
||||
|
||||
@@ -59,6 +59,8 @@ export function generateAuthenticatedUrl(
|
||||
baseUrl: string,
|
||||
path: string,
|
||||
lock: boolean,
|
||||
lockMainFields: boolean,
|
||||
lockCustomFields: boolean,
|
||||
authenticate: boolean,
|
||||
prefix = routerPrefix,
|
||||
hash = hashedPassword,
|
||||
@@ -72,5 +74,11 @@ export function generateAuthenticatedUrl(
|
||||
if (lock) {
|
||||
url.searchParams.append('locked', 'true');
|
||||
}
|
||||
if (lockMainFields) {
|
||||
url.searchParams.append('lmain', 'true');
|
||||
}
|
||||
if (lockCustomFields) {
|
||||
url.searchParams.append('lcustom', 'true');
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ export const validateGenerateUrl = [
|
||||
body('baseUrl').exists().isString().notEmpty().trim(),
|
||||
body('path').exists().isString().trim(),
|
||||
body('lock').exists().isBoolean(),
|
||||
body('lockMainFields').exists().isBoolean(),
|
||||
body('lockCustomFields').exists().isBoolean(),
|
||||
body('authenticate').exists().isBoolean(),
|
||||
|
||||
(req: Request, res: Response, next: NextFunction) => {
|
||||
|
||||
Reference in New Issue
Block a user