Skip to content

Commit

Permalink
affected_rows fix for gpus
Browse files Browse the repository at this point in the history
  • Loading branch information
JEMeyer committed Jul 29, 2024
1 parent 55a3fbf commit e6cb628
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/services/tables/assignments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ export const getAssignmentById = async (
export const updateAssignment = async (
id: number,
name: string,
modelName: string,
model_name: string,
port: number,
display_order: number
): Promise<number> => {
const query =
'UPDATE assignments SET name = ?, model_name = ?, port = ?, display_order = ? WHERE id = ?';
const result = await pool.query(query, [
name,
modelName,
model_name,
port,
display_order,
id,
Expand Down
4 changes: 2 additions & 2 deletions src/services/tables/gpus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ export const updateGPU = async (
display_order,
id,
]);
return Number(result[0].affectedRows);
return Number(result.affectedRows);
};

// Delete a GPU
export const deleteGPU = async (id: number): Promise<number> => {
const query = 'DELETE FROM gpus WHERE id = ?';
const result = await pool.query(query, [id]);
return Number(result[0].affectedRows);
return Number(result.affectedRows);
};

0 comments on commit e6cb628

Please sign in to comment.