Skip to content

Commit

Permalink
Send null for string like columns that don't allow empty strings when…
Browse files Browse the repository at this point in the history
… cell is cleared
  • Loading branch information
aniketkulkarni17 committed Nov 19, 2024
1 parent 08e9c26 commit 3a99532
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion mathesar_ui/src/stores/table-data/records.ts
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,16 @@ export class RecordsData {
const cellKey = getCellKey(rowKey, column.id);
this.meta.cellModificationStatus.set(cellKey, { state: 'processing' });
this.updatePromises?.get(cellKey)?.cancel();

const nullableColumnTypes = new Set([
"mathesar_types.email",

Check failure on line 596 in mathesar_ui/src/stores/table-data/records.ts

View workflow job for this annotation

GitHub Actions / Run front end linter

Strings must use singlequote
"date",

Check failure on line 597 in mathesar_ui/src/stores/table-data/records.ts

View workflow job for this annotation

GitHub Actions / Run front end linter

Strings must use singlequote
"timestamp with time zone",

Check failure on line 598 in mathesar_ui/src/stores/table-data/records.ts

View workflow job for this annotation

GitHub Actions / Run front end linter

Strings must use singlequote
"mathesar_types.uri",

Check failure on line 599 in mathesar_ui/src/stores/table-data/records.ts

View workflow job for this annotation

GitHub Actions / Run front end linter

Strings must use singlequote
"time with time zone",

Check failure on line 600 in mathesar_ui/src/stores/table-data/records.ts

View workflow job for this annotation

GitHub Actions / Run front end linter

Strings must use singlequote
]);
if (nullableColumnTypes.has(column.type) && record[column.id] === "") {

Check failure on line 602 in mathesar_ui/src/stores/table-data/records.ts

View workflow job for this annotation

GitHub Actions / Run front end linter

Strings must use singlequote
record[column.id] = null;
}
const promise = api.records
.patch({
...this.apiContext,
Expand Down

0 comments on commit 3a99532

Please sign in to comment.