Skip to content

Commit f3564a9

Browse files
ui: create datasource model without id (#366)
1 parent 72c693e commit f3564a9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ui/src/datasource/datasourceRest.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ export async function getDatasourceById(id: number): Promise<Datasource> {
4444
export async function createDatasource(
4545
datasource: Datasource,
4646
): Promise<Datasource> {
47-
const { ...creationDTO } = datasource;
47+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
48+
const { id, ...creationDTO } = datasource;
49+
4850
const response = await http.post('/datasources', JSON.stringify(creationDTO));
4951
return JSON.parse(response.data, reviver) as Datasource;
5052
}

0 commit comments

Comments
 (0)