Browse Source

fix(gui-v2): check if project title is being in use

pull/3112/head
Wing-Kam Wong 2 years ago
parent
commit
32b77870ea
  1. 5
      packages/nocodb/src/lib/meta/api/projectApis.ts

5
packages/nocodb/src/lib/meta/api/projectApis.ts

@ -50,6 +50,11 @@ export async function projectUpdate(
const data: any = { const data: any = {
title: DOMPurify.sanitize(req?.body?.title), title: DOMPurify.sanitize(req?.body?.title),
}; };
if (await Project.getByTitle(data.title)) {
NcError.badRequest('Project title already in use');
}
const result = await Project.update(req.params.projectId, data); const result = await Project.update(req.params.projectId, data);
Tele.emit('evt', { evt_type: 'project:update' }); Tele.emit('evt', { evt_type: 'project:update' });
res.json(result); res.json(result);

Loading…
Cancel
Save