Browse Source

fix: survey mode toggle api fail issue

Ramesh Mane 6 days ago
parent
commit
3cefbc921f
  1. 4
      packages/nc-gui/components/smartsheet/Form.vue
  2. 8
      packages/nocodb/src/services/views.service.ts

4
packages/nc-gui/components/smartsheet/Form.vue

@ -730,8 +730,8 @@ watch(submitted, (v) => {
}
})
watch(view, (nextView) => {
if (nextView?.type === ViewTypes.FORM) {
watch(view, (nextView, oldView) => {
if (nextView?.type === ViewTypes.FORM && nextView?.id !== oldView?.id) {
reloadEventHook.trigger()
}
})

8
packages/nocodb/src/services/views.service.ts

@ -278,7 +278,10 @@ export class ViewsService {
NcError.viewNotFound(param.viewId);
}
let customUrl: CustomUrl | undefined = await CustomUrl.get({
let customUrl: CustomUrl | undefined;
if (param.sharedView.custom_url_path !== undefined) {
customUrl = await CustomUrl.get({
view_id: view.id,
id: view.fk_custom_url_id,
});
@ -297,7 +300,7 @@ export class ViewsService {
await CustomUrl.delete({ id: view.fk_custom_url_id as string });
customUrl = undefined;
}
} else {
} else if (param.sharedView.custom_url_path) {
customUrl = await CustomUrl.insert({
fk_workspace_id: view.fk_workspace_id,
base_id: view.base_id,
@ -307,6 +310,7 @@ export class ViewsService {
custom_path: param.sharedView.custom_url_path,
});
}
}
const result = await View.update(context, param.viewId, {
...param.sharedView,

Loading…
Cancel
Save