diff --git a/schema.graphql b/schema.graphql index 15f7e115c4b..e6a8f34a4f5 100644 --- a/schema.graphql +++ b/schema.graphql @@ -1111,8 +1111,8 @@ input UserInput { email: EmailAddress! firstName: String! lastName: String! + organizationUserBelongsToId: ID password: String! - selectedOrgainzation: ID! } enum UserOrderByInput { @@ -1170,37 +1170,6 @@ type UserTagsConnectionResult { errors: [ConnectionError!]! } -type UserToReturn { - _id: ID! - address: Address - adminApproved: Boolean - adminFor: [Organization] - appLanguageCode: String! - birthDate: Date - createdAt: DateTime! - createdEvents: [Event] - createdOrganizations: [Organization] - educationGrade: EducationGrade - email: EmailAddress! - employmentStatus: EmploymentStatus - eventAdmin: [Event] - firstName: String! - gender: Gender - image: String - joinedOrganizations: [Organization] - lastName: String! - maritalStatus: MaritalStatus - membershipRequests: [MembershipRequest] - organizationsBlockedBy: [Organization] - phone: UserPhone - pluginCreationAllowed: Boolean! - registeredEvents: [Event] - tagsAssignedWith(after: String, before: String, first: PositiveInt, last: PositiveInt, organizationId: ID): UserTagsConnection - tokenVersion: Int! - updatedAt: DateTime! - userType: UserType! -} - enum UserType { ADMIN NON_USER diff --git a/tests/utilities/encodedImageStorage/uploadEncodedImage.spec.ts b/tests/utilities/encodedImageStorage/uploadEncodedImage.spec.ts index 7d774760b6e..479542a1d1e 100644 --- a/tests/utilities/encodedImageStorage/uploadEncodedImage.spec.ts +++ b/tests/utilities/encodedImageStorage/uploadEncodedImage.spec.ts @@ -46,20 +46,22 @@ describe("src -> utilities -> encodedImageStorage -> uploadEncodedImage", () => "NAAAAKElEQVQ4jWNgYGD4Twzu6FhFFGYYNXDUwGFpIAk2E4dHDRw1cDgaCAASFOffhEIO" + "3gAAAABJRU5ErkJggg=="; await uploadEncodedImage(img, null); - } catch (error: any) { - expect(error.message).toEqual(`Translated ${INVALID_FILE_TYPE.MESSAGE}`); + } catch (error: unknown) { + expect((error as Error).message).toEqual( + `Translated ${INVALID_FILE_TYPE.MESSAGE}` + ); expect(spy).toBeCalledWith(INVALID_FILE_TYPE.MESSAGE); } }); it("should not create new image if it is bigger than the limit", async () => { - const size = Number(process.env.IMAGE_SIZE_LIMIT_KB); + const size = Number(process.env.IMAGE_SIZE_LIMIT_KB) || 3000; try { const img = "data:image/jpg;base64," + generateRandomString(size + 1000); await uploadEncodedImage(img, null); - } catch (error: any) { - expect(error.message).toEqual(IMAGE_SIZE_LIMIT_KB.MESSAGE); + } catch (error: unknown) { + expect((error as Error).message).toEqual(IMAGE_SIZE_LIMIT_KB.MESSAGE); } }); @@ -71,7 +73,7 @@ describe("src -> utilities -> encodedImageStorage -> uploadEncodedImage", () => "3gAAAABJRU5ErkJggg=="; const fileName = await uploadEncodedImage(img, null); expect(fileName).not.toBe(null); - } catch (error: any) { + } catch (error: unknown) { console.log(error); } }); @@ -85,7 +87,7 @@ describe("src -> utilities -> encodedImageStorage -> uploadEncodedImage", () => const fileName = await uploadEncodedImage(img, null); expect(fileName).not.toBe(null); testPreviousImagePath = fileName; - } catch (error: any) { + } catch (error: unknown) { console.log(error); } }); @@ -180,7 +182,7 @@ describe("src -> utilities -> encodedImageStorage -> uploadEncodedImage", () => fs.unlink(path.join(__dirname, "../../../".concat(fileName)), (err) => { if (err) throw err; }); - } catch (error: any) { + } catch (error: unknown) { console.log(error); } });