Posts can generate new authors

This commit is contained in:
chegele 2023-11-14 16:17:08 -05:00
parent 1c8bcdcfc2
commit fd0defe071
1 changed files with 2 additions and 2 deletions

View File

@ -48,8 +48,8 @@ export class PostResolver {
@Args('content'!) content: string, @Args('content'!) content: string,
@Args('authorId'!) authorId: string, @Args('authorId'!) authorId: string,
) { ) {
const author = Member.getMember(authorId); let author = Member.getMember(authorId);
if (!author) return null; if (!author) author = new Member(authorId);
return new Post(id, title, content, author); return new Post(id, title, content, author);
} }