fix(server): invalidate old user avatar when updated (#7285)

fix CLOUD-41
This commit is contained in:
forehalo
2024-06-20 12:25:10 +00:00
parent a557fd3277
commit aa124638bc
6 changed files with 127 additions and 4 deletions

View File

@@ -6,6 +6,7 @@ import { PrismaClient } from '@prisma/client';
import cookieParser from 'cookie-parser';
import graphqlUploadExpress from 'graphql-upload/graphqlUploadExpress.mjs';
import type { Response } from 'supertest';
import supertest from 'supertest';
import { AppModule, FunctionalityModules } from '../../src/app.module';
import { AuthGuard, AuthModule } from '../../src/core/auth';
@@ -147,3 +148,15 @@ export function handleGraphQLError(resp: Response) {
throw new Error(stacktrace ? stacktrace.join('\n') : cause.message, cause);
}
}
export function gql(app: INestApplication, query?: string) {
const req = supertest(app.getHttpServer())
.post('/graphql')
.set({ 'x-request-id': 'test', 'x-operation-name': 'test' });
if (query) {
return req.send({ query });
}
return req;
}