Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions backend/src/entities/table/use-cases/get-table-rows.use.case.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ export class GetTableRowsUseCase extends AbstractUseCase<GetTableRowsDs, FoundTa

const allowCsvExport = tableSettings ? tableSettings.allow_csv_export : true;
const allowCsvImport = tableSettings ? tableSettings.allow_csv_import : true;
const can_delete = tableSettings ? tableSettings.can_delete : true;
const can_update = tableSettings ? tableSettings.can_update : true;
const can_add = tableSettings ? tableSettings.can_add : true;

//todo rework in daos
tableSettings = tableSettings ? tableSettings : ({} as TableSettingsEntity);
Expand Down Expand Up @@ -241,19 +244,19 @@ export class GetTableRowsUseCase extends AbstractUseCase<GetTableRowsDs, FoundTa
allow_csv_export: allowCsvExport,
allow_csv_import: allowCsvImport,
saved_filters: savedTableFilters.map((el) => buildCreatedTableFilterRO(el)),
can_delete: tableSettings ? tableSettings.can_delete : true,
can_update: tableSettings ? tableSettings.can_update : true,
can_add: tableSettings ? tableSettings.can_add : true,
can_delete: can_delete,
can_update: can_update,
can_add: can_add,
table_settings: {
sortable_by: tableSettings?.sortable_by?.length > 0 ? tableSettings.sortable_by : [],
ordering: tableSettings.ordering ? tableSettings.ordering : undefined,
identity_column: tableSettings.identity_column ? tableSettings.identity_column : null,
list_fields: tableSettings?.list_fields?.length > 0 ? tableSettings.list_fields : [],
allow_csv_export: allowCsvExport,
allow_csv_import: allowCsvImport,
can_delete: tableSettings ? tableSettings.can_delete : true,
can_update: tableSettings ? tableSettings.can_update : true,
can_add: tableSettings ? tableSettings.can_add : true,
can_delete: can_delete,
can_update: can_update,
can_add: can_add,
},
};

Expand Down
Loading