adding buttons to remove listings from a given job

This commit is contained in:
orangecoding
2025-10-03 13:04:35 +02:00
parent 31a14a0352
commit 4b15894603
5 changed files with 67 additions and 9 deletions

View File

@@ -251,3 +251,14 @@ export const queryListings = ({
return { totalNumber, page: safePage, result: rows };
};
/**
* Delete all listings for a given job id.
*
* @param {string} jobId - The job identifier whose listings should be removed.
* @returns {any} The result from SqliteConnection.execute (may contain changes count).
*/
export const deleteListings = (jobId) => {
if (!jobId) return;
return SqliteConnection.execute(`DELETE FROM listings WHERE job_id = @jobId`, { jobId });
};