Browse Source

Merge pull request #3112 from nocodb/fix/gui-v2-project-rename

fix(gui-v2): check if project title is being in use when renaming
pull/3113/head
navi 2 years ago committed by GitHub
parent
commit
14e054c98e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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