Skip to content

Commit 7ae46f7

Browse files
committed
add: await keyword for bug report
1 parent 5f656f9 commit 7ae46f7

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

src/graphql/post.ts

+5-19
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@ import { ApolloContext } from './../app';
22
import { gql, IResolvers, ApolloError, AuthenticationError } from 'apollo-server-koa';
33
import Post from '../entity/Post';
44
import { getRepository, getManager, LessThan, Not, MoreThan } from 'typeorm';
5-
import { normalize, escapeForUrl, checkEmpty } from '../lib/utils';
5+
import { normalize } from '../lib/utils';
66
import removeMd from 'remove-markdown';
7-
import PostsTags from '../entity/PostsTags';
8-
import Tag from '../entity/Tag';
97
import UrlSlugHistory from '../entity/UrlSlugHistory';
108
import Comment from '../entity/Comment';
119
import Series from '../entity/Series';
1210
import SeriesPosts, { subtractIndexAfter, appendToSeries } from '../entity/SeriesPosts';
13-
import generate from 'nanoid/generate';
1411
import PostLike from '../entity/PostLike';
1512
import keywordSearch from '../search/keywordSearch';
1613
import searchSync from '../search/searchSync';
@@ -20,26 +17,15 @@ import PostRead from '../entity/PostRead';
2017
import hash from '../lib/hash';
2118
import cache from '../cache';
2219
import PostReadLog from '../entity/PostReadLog';
23-
import { nextSpamFilter } from '../etc/spamFilter';
24-
import Axios, { AxiosResponse } from 'axios';
25-
import LRU from 'lru-cache';
26-
import { createLikeLog, createReadLog } from '../lib/bigQuery';
20+
import Axios from 'axios';
21+
import { createReadLog } from '../lib/bigQuery';
2722
import esClient from '../search/esClient';
2823
import { buildFallbackRecommendedPosts, buildRecommendedPostsQuery } from '../search/buildQuery';
2924
import { pickRandomItems } from '../etc/pickRandomItems';
30-
import geoipCountry from 'geoip-country';
3125
import { purgeRecentPosts, purgeUser, purgePost } from '../lib/graphcdn';
3226
import imageService from '../services/imageService';
3327
import externalInterationService from '../services/externalIntegrationService';
3428
import postService from '../services/postService';
35-
import { checkBlockList } from '../lib/checkBlockList';
36-
import userService from '../services/userService';
37-
import { verifyTurnstileToken } from '../lib/turnstile';
38-
39-
const lruCache = new LRU<string, string[]>({
40-
max: 150,
41-
maxAge: 1000 * 60 * 60,
42-
});
4329

4430
type ReadingListQueryParams = {
4531
type: 'LIKED' | 'READ';
@@ -660,10 +646,10 @@ export const resolvers: IResolvers<any, ApolloContext> = {
660646
},
661647
Mutation: {
662648
writePost: async (parent: any, args, ctx) => {
663-
return postService.write(args, ctx.cookies);
649+
return await postService.write(args, ctx.cookies);
664650
},
665651
editPost: async (parent: any, args, ctx) => {
666-
return postService.edit(args, ctx.cookies);
652+
return await postService.edit(args, ctx.cookies);
667653
},
668654
removePost: async (parent: any, args, ctx) => {
669655
const { id } = args as { id: string };

0 commit comments

Comments
 (0)