Skip to content

Commit cbb1282

Browse files
anaisbergSimonClo
authored andcommitted
🏷️ type database row
1 parent 7e31e6c commit cbb1282

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/frontend/apps/impress/src/features/docs/doc-editor/components/custom-blocks/DatabaseBlock/AddRowButton.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
import { Button } from '@openfun/cunningham-react';
22
import { Dispatch, SetStateAction } from 'react';
33

4+
import { DatabaseRow } from './types';
45
import { createNewRow } from './utils';
56

67
export const AddRowButton = ({
78
columns,
89
setRowData,
910
}: {
1011
columns: string[];
11-
setRowData: Dispatch<
12-
SetStateAction<Record<string, string | number | boolean>[] | undefined>
13-
>;
12+
setRowData: Dispatch<SetStateAction<DatabaseRow[] | undefined>>;
1413
}) => {
1514
const addRow = () => {
1615
const newRow = createNewRow('', columns);
17-
setRowData((prev) => {
16+
setRowData((prev: DatabaseRow[] | undefined) => {
1817
if (prev === undefined) {
1918
return [newRow];
2019
}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export type DatabaseRow = Record<string, string | number | boolean>;
1+
export type DatabaseRow = Record<string, string | number | boolean | undefined>;

0 commit comments

Comments
 (0)