|
|
|
@ -1,12 +1,10 @@
|
|
|
|
|
import {GraphQLError} from "graphql";
|
|
|
|
|
import {FileUpload} from "graphql-upload";
|
|
|
|
|
import * as yaml from "js-yaml";
|
|
|
|
|
import isEmail from "validator/lib/isEmail";
|
|
|
|
|
import dataAccess from "../../lib/dataAccess";
|
|
|
|
|
import {BlacklistedError} from "../../lib/errors/BlacklistedError";
|
|
|
|
|
import {GroupNotFoundError} from "../../lib/errors/GroupNotFoundError";
|
|
|
|
|
import {InvalidEmailError} from "../../lib/errors/InvalidEmailError";
|
|
|
|
|
import {InvalidFileError} from "../../lib/errors/InvalidFileError";
|
|
|
|
|
import {NotAGroupAdminError} from "../../lib/errors/NotAGroupAdminError";
|
|
|
|
|
import {NotAnAdminError} from "../../lib/errors/NotAnAdminError";
|
|
|
|
|
import {NotTheGroupCreatorError} from "../../lib/errors/NotTheGroupCreatorError";
|
|
|
|
@ -14,7 +12,6 @@ import {PostNotFoundError} from "../../lib/errors/PostNotFoundError";
|
|
|
|
|
import globals from "../../lib/globals";
|
|
|
|
|
import {InternalEvents} from "../../lib/InternalEvents";
|
|
|
|
|
import {Activity, BlacklistedPhrase, ChatMessage, ChatRoom, Event, Group, Post, Request, User} from "../../lib/models";
|
|
|
|
|
import {is} from "../../lib/regex";
|
|
|
|
|
import {UploadManager} from "../../lib/UploadManager";
|
|
|
|
|
import {BaseResolver} from "./BaseResolver";
|
|
|
|
|
|
|
|
|
@ -147,7 +144,7 @@ export class MutationResolver extends BaseResolver {
|
|
|
|
|
* @param request
|
|
|
|
|
*/
|
|
|
|
|
public async createPost(
|
|
|
|
|
{content, activityId, type}: { content: string, activityId?: number, type: dataAccess.PostType},
|
|
|
|
|
{content, activityId, type}: { content: string, activityId?: number, type: dataAccess.PostType },
|
|
|
|
|
request: any): Promise<Post> {
|
|
|
|
|
this.ensureLoggedIn(request);
|
|
|
|
|
if (content.length > 2048) {
|
|
|
|
|