diff --git a/server/src/generated/prisma-client/index.d.ts b/server/src/generated/prisma-client/index.d.ts index 98e05ac..5693e9f 100644 --- a/server/src/generated/prisma-client/index.d.ts +++ b/server/src/generated/prisma-client/index.d.ts @@ -509,8 +509,6 @@ export type UserOrderByInput = | "location_DESC" | "image_ASC" | "image_DESC" - | "bio_ASC" - | "bio_DESC" | "date_ASC" | "date_DESC"; @@ -1119,7 +1117,6 @@ export interface UserUpdateManyMutationInput { lastName?: Maybe; location?: Maybe; image?: Maybe; - bio?: Maybe; } export interface UserWhereInput { @@ -1221,20 +1218,6 @@ export interface UserWhereInput { image_not_starts_with?: Maybe; image_ends_with?: Maybe; image_not_ends_with?: Maybe; - bio?: Maybe; - bio_not?: Maybe; - bio_in?: Maybe; - bio_not_in?: Maybe; - bio_lt?: Maybe; - bio_lte?: Maybe; - bio_gt?: Maybe; - bio_gte?: Maybe; - bio_contains?: Maybe; - bio_not_contains?: Maybe; - bio_starts_with?: Maybe; - bio_not_starts_with?: Maybe; - bio_ends_with?: Maybe; - bio_not_ends_with?: Maybe; date?: Maybe; date_not?: Maybe; date_in?: Maybe; @@ -1430,8 +1413,7 @@ export interface UserCreateInput { firstName: String; lastName: String; location: String; - image: String; - bio: String; + image?: Maybe; } export interface FaqCreateManyInput { @@ -1750,7 +1732,6 @@ export interface UserUpdateInput { lastName?: Maybe; location?: Maybe; image?: Maybe; - bio?: Maybe; } export interface ContactInfoUpdateDataInput { @@ -2328,8 +2309,7 @@ export interface UserPreviousValues { firstName: String; lastName: String; location: String; - image: String; - bio: String; + image?: String; date: DateTimeOutput; } @@ -2343,7 +2323,6 @@ export interface UserPreviousValuesPromise lastName: () => Promise; location: () => Promise; image: () => Promise; - bio: () => Promise; date: () => Promise; } @@ -2357,7 +2336,6 @@ export interface UserPreviousValuesSubscription lastName: () => Promise>; location: () => Promise>; image: () => Promise>; - bio: () => Promise>; date: () => Promise>; } @@ -2630,8 +2608,7 @@ export interface User { firstName: String; lastName: String; location: String; - image: String; - bio: String; + image?: String; date: DateTimeOutput; } @@ -2643,7 +2620,6 @@ export interface UserPromise extends Promise, Fragmentable { lastName: () => Promise; location: () => Promise; image: () => Promise; - bio: () => Promise; date: () => Promise; } @@ -2657,7 +2633,6 @@ export interface UserSubscription lastName: () => Promise>; location: () => Promise>; image: () => Promise>; - bio: () => Promise>; date: () => Promise>; } @@ -2671,7 +2646,6 @@ export interface UserNullablePromise lastName: () => Promise; location: () => Promise; image: () => Promise; - bio: () => Promise; date: () => Promise; } diff --git a/server/src/generated/prisma-client/prisma-schema.js b/server/src/generated/prisma-client/prisma-schema.js index 40fc489..aa0e03c 100644 --- a/server/src/generated/prisma-client/prisma-schema.js +++ b/server/src/generated/prisma-client/prisma-schema.js @@ -2134,8 +2134,7 @@ type User { firstName: String! lastName: String! location: String! - image: String! - bio: String! + image: String date: DateTime! } @@ -2152,8 +2151,7 @@ input UserCreateInput { firstName: String! lastName: String! location: String! - image: String! - bio: String! + image: String } type UserEdge { @@ -2176,8 +2174,6 @@ enum UserOrderByInput { location_DESC image_ASC image_DESC - bio_ASC - bio_DESC date_ASC date_DESC } @@ -2189,8 +2185,7 @@ type UserPreviousValues { firstName: String! lastName: String! location: String! - image: String! - bio: String! + image: String date: DateTime! } @@ -2219,7 +2214,6 @@ input UserUpdateInput { lastName: String location: String image: String - bio: String } input UserUpdateManyMutationInput { @@ -2229,7 +2223,6 @@ input UserUpdateManyMutationInput { lastName: String location: String image: String - bio: String } input UserWhereInput { @@ -2331,20 +2324,6 @@ input UserWhereInput { image_not_starts_with: String image_ends_with: String image_not_ends_with: String - bio: String - bio_not: String - bio_in: [String!] - bio_not_in: [String!] - bio_lt: String - bio_lte: String - bio_gt: String - bio_gte: String - bio_contains: String - bio_not_contains: String - bio_starts_with: String - bio_not_starts_with: String - bio_ends_with: String - bio_not_ends_with: String date: DateTime date_not: DateTime date_in: [DateTime!] diff --git a/server/src/schema.graphql b/server/src/schema.graphql index 3d20194..756a873 100644 --- a/server/src/schema.graphql +++ b/server/src/schema.graphql @@ -21,5 +21,7 @@ type AuthPayload { type User { id: ID! email: String! - name: String! + firstName: String! + lastName: String! + location: String! } diff --git a/server/src/utils.js b/server/src/utils.js index b036306..0d72e72 100644 --- a/server/src/utils.js +++ b/server/src/utils.js @@ -1,23 +1,23 @@ -const jwt = require('jsonwebtoken') +const jwt = require("jsonwebtoken"); function getUserId(context) { - const Authorization = context.request.get('Authorization') + const Authorization = context.request.get("Authorization"); if (Authorization) { - const token = Authorization.replace('Bearer ', '') - const { userId } = jwt.verify(token, process.env.APP_SECRET) - return userId + const token = Authorization.replace("Bearer ", ""); + const { userId } = jwt.verify(token, process.env.APP_SECRET); + return userId; } - throw new AuthError() + throw new AuthError(); } class AuthError extends Error { constructor() { - super('Not authorized') + super("Not authorized"); } } module.exports = { getUserId, AuthError -} \ No newline at end of file +};