refactor(api): check if coAuthor form field is an empty string
if it is, set coAuthor in document to null, otherwise, set it to the provided value
This commit is contained in:
parent
696ce44290
commit
18f11f7ca7
@ -33,7 +33,7 @@ export default eventHandler(async (ev) => {
|
||||
const update: Partial<IStory> = {
|
||||
title: body.title,
|
||||
completed: body.completed,
|
||||
coAuthor: body.coAuthor,
|
||||
coAuthor: !!body.coAuthor ? body.coAuthor : null,
|
||||
chapters: [],
|
||||
};
|
||||
for (const oc of os.chapters) {
|
||||
|
Loading…
Reference in New Issue
Block a user