Catch sqlite exceptions, add tag list endpoint

This commit is contained in:
DominikDoom
2023-09-24 20:06:40 +02:00
parent 109a8a155e
commit 6cf9acd6ab
3 changed files with 43 additions and 25 deletions

View File

@@ -179,7 +179,10 @@ function increaseUseCount(tagName) {
}
// Get use count of tag from the database
async function getUseCount(tagName) {
return (await fetchAPI(`tacapi/v1/get-use-count/${tagName}`, true, false))["count"];
return (await fetchAPI(`tacapi/v1/get-use-count/${tagName}`, true, false))["result"];
}
async function getUseCounts(tagNames) {
return (await fetchAPI(`tacapi/v1/get-use-count-list?tags=${tagNames.join("&tags=")}`))["result"];
}
// Sliding window function to get possible combination groups of an array