|
1 | 1 | import { eq } from "drizzle-orm";
|
| 2 | +import type { Column, ColumnBaseConfig, ColumnDataType } from "drizzle-orm"; |
2 | 3 | import type { FastifyInstance, FastifyReply } from "fastify";
|
3 | 4 | import type { Client } from "minio";
|
4 | 5 | import { beforeEach, describe, expect, it, vi } from "vitest";
|
5 |
| -import type { |
6 |
| - ExplicitAuthenticationTokenPayload, |
7 |
| -} from "../../../../src/graphql/context"; |
| 6 | +import type { ExplicitAuthenticationTokenPayload } from "../../../../src/graphql/context"; |
8 | 7 | import { TalawaGraphQLError } from "../../../../src/utilities/TalawaGraphQLError";
|
9 |
| -import type { |
10 |
| - Column, |
11 |
| - ColumnBaseConfig, |
12 |
| - ColumnDataType |
13 |
| -} from 'drizzle-orm'; |
14 | 8 |
|
15 | 9 | interface CurrentClient {
|
16 | 10 | isAuthenticated: true;
|
@@ -219,15 +213,19 @@ const createMockContext = (overrides?: Partial<TestContext>): TestContext => ({
|
219 | 213 | });
|
220 | 214 |
|
221 | 215 | type OrganizationFields = {
|
222 |
| - organizationId: Column<ColumnBaseConfig<ColumnDataType, string>, object, object>; |
| 216 | + organizationId: Column< |
| 217 | + ColumnBaseConfig<ColumnDataType, string>, |
| 218 | + object, |
| 219 | + object |
| 220 | + >; |
223 | 221 | };
|
224 | 222 |
|
225 | 223 | type WhereOperators = {
|
226 |
| - eq: typeof eq; |
| 224 | + eq: typeof eq; |
227 | 225 | };
|
228 | 226 |
|
229 | 227 | type UserFields = {
|
230 |
| - id: Column<ColumnBaseConfig<ColumnDataType, string>, object, object>; |
| 228 | + id: Column<ColumnBaseConfig<ColumnDataType, string>, object, object>; |
231 | 229 | };
|
232 | 230 |
|
233 | 231 | const resolveCreator = async (
|
@@ -255,10 +253,7 @@ const resolveCreator = async (
|
255 | 253 | role: true,
|
256 | 254 | organizationId: true,
|
257 | 255 | },
|
258 |
| - where: ( |
259 |
| - fields: OrganizationFields, |
260 |
| - operators: WhereOperators, |
261 |
| - ) => { |
| 256 | + where: (fields: OrganizationFields, operators: WhereOperators) => { |
262 | 257 | return operators.eq(fields.organizationId, parent.id);
|
263 | 258 | },
|
264 | 259 | },
|
|
0 commit comments