Auto stash before merge of "julius-dev" and "origin/julius-dev"

pull/2/head
Trivernis 5 years ago
parent 76f7593b02
commit dc3f9f1702

@ -144,9 +144,13 @@ export function resolver(req: any, res: any): any {
async createPost({content}: { content: string }) {
if (content) {
if (req.session.userId) {
const post = await dataaccess.createPost(content, req.session.userId);
globals.internalEmitter.emit(InternalEvents.GQLPOSTCREATE, post);
return post;
if (content.length > 2048) {
return new GraphQLError("Content too long.");
} else {
const post = await dataaccess.createPost(content, req.session.userId);
globals.internalEmitter.emit(InternalEvents.GQLPOSTCREATE, post);
return post;
}
} else {
res.status(status.UNAUTHORIZED);
return new NotLoggedInGqlError();

Loading…
Cancel
Save