Posts can generate new authors
This commit is contained in:
parent
1c8bcdcfc2
commit
fd0defe071
|
@ -48,8 +48,8 @@ export class PostResolver {
|
|||
@Args('content'!) content: string,
|
||||
@Args('authorId'!) authorId: string,
|
||||
) {
|
||||
const author = Member.getMember(authorId);
|
||||
if (!author) return null;
|
||||
let author = Member.getMember(authorId);
|
||||
if (!author) author = new Member(authorId);
|
||||
return new Post(id, title, content, author);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue