diff --git a/src/controllers/assignments.ts b/src/controllers/assignments.ts index df056c6..5d89e61 100644 --- a/src/controllers/assignments.ts +++ b/src/controllers/assignments.ts @@ -74,7 +74,7 @@ export const updateAssignment = async (req: Request, res: Response) => { const idAsNumber = Number(id); // First update the assignment record, and pull all current assignmentGpus - const [affectedARows, currentAssignmentGpus] = await Promise.all([ + const [affectedRows, currentAssignmentGpus] = await Promise.all([ AssignmentService.updateAssignment( idAsNumber, name, @@ -106,7 +106,7 @@ export const updateAssignment = async (req: Request, res: Response) => { .filter(Boolean) ) ); - res.json({ affectedARows }); + res.json({ affectedRows }); }; export const deployAssignments = async (req: Request, res: Response) => { diff --git a/src/controllers/gpu.ts b/src/controllers/gpu.ts index b55433b..53bfc0f 100644 --- a/src/controllers/gpu.ts +++ b/src/controllers/gpu.ts @@ -35,7 +35,7 @@ export const deleteGPU = async (req: Request, res: Response) => { export const updateGPU = async (req: Request, res: Response) => { const { id } = req.params; const { name, vram_size, computer_id, weight, display_order } = req.body; - await GpuService.updateGPU( + const affectedRows = await GpuService.updateGPU( Number(id), name, vram_size, @@ -43,7 +43,7 @@ export const updateGPU = async (req: Request, res: Response) => { display_order, weight ); - res.sendStatus(204); + res.json({ affectedRows }); }; export const getGpuLockStatuses = async (_req: Request, res: Response) => { diff --git a/src/controllers/model.ts b/src/controllers/model.ts index 36967c5..289ccc8 100644 --- a/src/controllers/model.ts +++ b/src/controllers/model.ts @@ -95,16 +95,21 @@ export const deleteModel = async (req: Request, res: Response) => { export const updateModel = async (req: Request, res: Response) => { const { name, size, model_type, display_order } = req.body; + let affectedRows = 0; switch (model_type) { case 'llm': - await LlmService.updateLLM(name, size, display_order); + affectedRows = await LlmService.updateLLM(name, size, display_order); break; case 'diffusor': - await DiffusorService.updateDiffusor(name, size, display_order); + affectedRows = await DiffusorService.updateDiffusor( + name, + size, + display_order + ); break; case 'stt': case 'tts': - await SpeechModelService.updateSpeechModel( + affectedRows = await SpeechModelService.updateSpeechModel( name, size, model_type, @@ -116,5 +121,5 @@ export const updateModel = async (req: Request, res: Response) => { return; } - res.sendStatus(204); + res.json({ affectedRows }); };