tags_assign: user_id instead of prefix

This commit is contained in:
Flummi
2021-12-23 10:07:12 +01:00
parent b2f45dc70e
commit bad5a5f7f0
9 changed files with 23 additions and 25 deletions

View File

@@ -99,7 +99,9 @@ export default new class {
};
async getTags(itemid) {
const tags = await sql("tags_assign")
.select("tags.id", "tags.tag", "user.user")
.leftJoin("tags", "tags.id", "tags_assign.tag_id")
.leftJoin("user", "user.id", "tags_assign.user_id")
.where("tags_assign.item_id", itemid);
for(let t = 0; t < tags.length; t++)
tags[t].tag = tags[t].tag.replace(/[\u00A0-\u9999<>\&]/g, i => '&#'+i.charCodeAt(0)+';');