Browse Source

refactor: take string 'true' as truthy value

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5272/head
Pranav C 2 years ago
parent
commit
a5a671df04
  1. 2
      packages/nocodb/src/lib/controllers/plugin.ctl.ts
  2. 2
      packages/nocodb/src/lib/services/hook.svc.ts
  3. 2
      packages/nocodb/src/lib/services/util.svc.ts

2
packages/nocodb/src/lib/controllers/plugin.ctl.ts

@ -36,7 +36,7 @@ export async function isPluginActive(req: Request, res: Response) {
}
const blockInCloudMw = (_req, res, next) => {
if (process.env.NC_CLOUD) {
if (process.env.NC_CLOUD === 'true') {
res.status(403).send('Not allowed');
} else next();
}

2
packages/nocodb/src/lib/services/hook.svc.ts

@ -16,7 +16,7 @@ function validateHookPayload(notificationJsonOrObject: string | object) {
: notificationJsonOrObject;
} catch {}
if (notification.type !== 'URL' && process.env.NC_CLOUD) {
if (notification.type !== 'URL' && process.env.NC_CLOUD === 'true') {
NcError.badRequest('Only URL notification is supported');
}
}

2
packages/nocodb/src/lib/services/util.svc.ts

@ -56,7 +56,7 @@ export async function appInfo(param: { req: { ncSiteUrl: string } }) {
ee: Noco.isEE(),
ncAttachmentFieldSize: NC_ATTACHMENT_FIELD_SIZE,
ncMaxAttachmentsAllowed: +(process.env.NC_MAX_ATTACHMENTS_ALLOWED || 10),
isCloud: !!process.env.NC_CLOUD,
isCloud: process.env.NC_CLOUD === 'true',
};
return result;

Loading…
Cancel
Save