Skip to content

Commit 85889cf

Browse files
authored
Set line creator if not already defined (#305)
Adds logic to assign the line's creator property to the user's agent if it is undefined when processing items. This ensures that the creator information is consistently set for new or updated lines.
1 parent a6c28ca commit 85889cf

2 files changed

Lines changed: 46 additions & 13 deletions

File tree

package-lock.json

Lines changed: 45 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

page/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ router.route('/:pageId')
9999
const line = item.id?.startsWith?.('http')
100100
? new Line(item)
101101
: Line.build(projectId, pageId, item, user.agent.split('/').pop())
102+
line.creator ??= user.agent.split('/').pop()
102103
return await line.update()
103104
}))
104105
}

0 commit comments

Comments
 (0)