forked from DebaucheryLibrarian/traxxx
Generalized tags to allow them to be assigned to anything.
This commit is contained in:
@@ -1545,13 +1545,13 @@ exports.seed = knex => Promise.resolve()
|
||||
return upsert('tags_groups', groups, duplicatesBySlug, 'slug', knex);
|
||||
})
|
||||
.then(async () => {
|
||||
const [duplicates, groups] = await Promise.all([
|
||||
const [duplicates, groupEntries] = await Promise.all([
|
||||
knex('tags').select('*'),
|
||||
knex('tags_groups').select('*'),
|
||||
]);
|
||||
|
||||
const duplicatesBySlug = duplicates.reduce((acc, tag) => ({ ...acc, [tag.slug]: tag }), {});
|
||||
const groupsMap = groups.reduce((acc, { id, slug }) => ({ ...acc, [slug]: id }), {});
|
||||
const groupsMap = groupEntries.reduce((acc, { id, slug }) => ({ ...acc, [slug]: id }), {});
|
||||
|
||||
const tags = getTags(groupsMap);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user