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