Skip to content

Commit 526e743

Browse files
fix: creating tags with leading/traling slashes
1 parent 65dcf9b commit 526e743

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: server/src/utils/tag.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const upsertTags = async (repository: ITagRepository, { userId, tags }: U
1111
const parts = tag.split('/');
1212
let parent: TagEntity | undefined;
1313

14-
for (const part of parts) {
14+
for (const part of parts.filter(Boolean)) {
1515
const value = parent ? `${parent.value}/${part}` : part;
1616
parent = await repository.upsertValue({ userId, value, parent });
1717
}

0 commit comments

Comments
 (0)