Make code more readable
This commit is contained in:
parent
ffdfb731fb
commit
231c8ccaab
|
@ -18,12 +18,16 @@ export async function save(ctx: UserCtx<SaveTableRequest, SaveTableResponse>) {
|
||||||
_rename?: RenameColumn
|
_rename?: RenameColumn
|
||||||
} = {
|
} = {
|
||||||
_id: generateTableID(),
|
_id: generateTableID(),
|
||||||
views: {},
|
|
||||||
...rest,
|
...rest,
|
||||||
// Ensure these fields are populated, even if not sent in the request
|
// Ensure these fields are populated, even if not sent in the request
|
||||||
type: rest.type || "table",
|
type: rest.type || "table",
|
||||||
sourceType: rest.sourceType || TableSourceType.INTERNAL,
|
sourceType: rest.sourceType || TableSourceType.INTERNAL,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!tableToSave.views) {
|
||||||
|
tableToSave.views = {}
|
||||||
|
}
|
||||||
|
|
||||||
const renaming = tableToSave._rename
|
const renaming = tableToSave._rename
|
||||||
delete tableToSave._rename
|
delete tableToSave._rename
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue