Skip to content

Commit

Permalink
copied newest commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ericlin2 committed Sep 21, 2024
1 parent db666b2 commit 159603d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/topics/tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ module.exports = function (Topics) {
await renameTag(tagData.value, tagData.newName);
}
};

const updateTagValues = tags => tags.map(tagItem => tagItem.value);
async function renameTag(tag, newTagName) {
if (!newTagName || tag === newTagName) {
return;
Expand All @@ -157,9 +157,6 @@ module.exports = function (Topics) {
await db.sortedSetRemove(cids.map(cid => `cid:${cid}:tag:${tag}:topics`), tids);

// update 'tags' field in topic hash
function getTagValues(tags) {
return tags.map(tagItem => tagItem.value);
}
topicData.forEach((topic) => {
topic.tags = updateTagValues(topic.tags);
const index = topic.tags.indexOf(tag);
Expand Down

0 comments on commit 159603d

Please sign in to comment.