diff --git a/src/graphql/auth.api.ts b/src/graphql/auth.api.ts index 83634e2..ab47eaa 100644 --- a/src/graphql/auth.api.ts +++ b/src/graphql/auth.api.ts @@ -18,7 +18,6 @@ export const SIGNUP = gql` country zip } - active role } token @@ -44,7 +43,6 @@ export const LOGIN = gql` country zip } - active role } token @@ -69,7 +67,6 @@ export const RESET_PASSWORD = gql` country zip } - active role } } @@ -92,7 +89,6 @@ export const CONFIRM_USER_RESET_PASSWORD = gql` country zip } - active role } } @@ -129,7 +125,6 @@ export const UPDATE_USER_INFO = gql` country zip } - active role } } @@ -152,8 +147,60 @@ export const UPDATE_USER_PASSWORD = gql` country zip } - active role } } `; + +export const DELETE_USER = gql` + mutation DeleteUser($id: String!, $password: String!) { + deleteUser(id: $id, password: $password) { + id + email + firstName + lastName + phone { + prefix + number + } + address { + place + city + country + zip + } + role + } + } +`; + +export const GET_USER_BY_ID = gql` + query GetUserById($id: String!) { + getUserById(id: $id) { + id + email + firstName + lastName + phone { + prefix + number + } + address { + place + city + country + zip + } + role + } + } +`; + +export const GET_COUNTRY_CODES = gql` + query GetCountryCodes { + getCountryCode { + prefix + country + } + } +`; diff --git a/src/graphql/types.ts b/src/graphql/types.ts index 589842e..c99c626 100644 --- a/src/graphql/types.ts +++ b/src/graphql/types.ts @@ -41,6 +41,12 @@ export type CategoryResponseModel = { image: File; }; +export type CountryPrefixModel = { + __typename?: 'CountryPrefixModel'; + country: Scalars['String']; + prefix: Scalars['String']; +}; + export type FeatureResponseModel = { __typename?: 'FeatureResponseModel'; id: Scalars['String']; @@ -94,8 +100,7 @@ export type MutationRoot = { deleteCategory: CategoryResponseModel; deleteFeature: FeatureResponseModel; deleteTemplate: TemplateModel; - addTemplateFeature: TemplateResponseModel; - deleteTemplateFeature: TemplateResponseModel; + updateTemplateFeature: TemplateResponseModel; addTemplateSpecification: TemplateResponseModel; }; @@ -113,7 +118,6 @@ export type MutationRootCreateUserArgs = { lastName: Scalars['String']; phone: PhoneInputModel; address: AddressInputModel; - active: Scalars['Boolean']; role: Role; }; @@ -172,18 +176,12 @@ export type MutationRootDeleteTemplateArgs = { }; -export type MutationRootAddTemplateFeatureArgs = { +export type MutationRootUpdateTemplateFeatureArgs = { id: Scalars['String']; featuresId: Array; }; -export type MutationRootDeleteTemplateFeatureArgs = { - id: Scalars['String']; - featuerId: Scalars['String']; -}; - - export type MutationRootAddTemplateSpecificationArgs = { id: Scalars['String']; specification: SpecificationInput; @@ -249,6 +247,7 @@ export type QueryRoot = { getAllCategories: Array; getAllFeatures: Array; getAllTemplates: Array; + getCountryCode: Array; }; @@ -328,7 +327,6 @@ export type UserResponseModel = { lastName: Scalars['String']; phone: PhoneModel; address: AddressModel; - active: Scalars['Boolean']; role: Scalars['String']; }; @@ -345,7 +343,7 @@ export type SignupMutation = ( & Pick & { user: ( { __typename?: 'UserResponseModel' } - & Pick + & Pick & { phone: ( { __typename?: 'PhoneModel' } & Pick @@ -370,7 +368,7 @@ export type LoginMutation = ( & Pick & { user: ( { __typename?: 'UserResponseModel' } - & Pick + & Pick & { phone: ( { __typename?: 'PhoneModel' } & Pick @@ -391,7 +389,7 @@ export type ResetPasswordMutation = ( { __typename?: 'MutationRoot' } & { resetUserPassword: ( { __typename?: 'UserResponseModel' } - & Pick + & Pick & { phone: ( { __typename?: 'PhoneModel' } & Pick @@ -412,7 +410,7 @@ export type ConfirmUserResetPasswordMutation = ( { __typename?: 'MutationRoot' } & { confirmUserResetPassword: ( { __typename?: 'UserResponseModel' } - & Pick + & Pick & { phone: ( { __typename?: 'PhoneModel' } & Pick @@ -437,7 +435,7 @@ export type UpdateUserInfoMutation = ( { __typename?: 'MutationRoot' } & { updateUserInfo: ( { __typename?: 'UserResponseModel' } - & Pick + & Pick & { phone: ( { __typename?: 'PhoneModel' } & Pick @@ -458,7 +456,7 @@ export type UpdateUserPasswordMutation = ( { __typename?: 'MutationRoot' } & { updateUserPassword: ( { __typename?: 'UserResponseModel' } - & Pick + & Pick & { phone: ( { __typename?: 'PhoneModel' } & Pick @@ -468,3 +466,55 @@ export type UpdateUserPasswordMutation = ( ) } ) } ); + +export type DeleteUserMutationVariables = Exact<{ + id: Scalars['String']; + password: Scalars['String']; +}>; + + +export type DeleteUserMutation = ( + { __typename?: 'MutationRoot' } + & { deleteUser: ( + { __typename?: 'UserResponseModel' } + & Pick + & { phone: ( + { __typename?: 'PhoneModel' } + & Pick + ), address: ( + { __typename?: 'AddressModel' } + & Pick + ) } + ) } +); + +export type GetUserByIdQueryVariables = Exact<{ + id: Scalars['String']; +}>; + + +export type GetUserByIdQuery = ( + { __typename?: 'QueryRoot' } + & { getUserById: ( + { __typename?: 'UserResponseModel' } + & Pick + & { phone: ( + { __typename?: 'PhoneModel' } + & Pick + ), address: ( + { __typename?: 'AddressModel' } + & Pick + ) } + ) } +); + +export type GetCountryCodesQueryVariables = Exact<{ [key: string]: never; }>; + + +export type GetCountryCodesQuery = ( + { __typename?: 'QueryRoot' } + & { getCountryCode: Array<( + { __typename?: 'CountryPrefixModel' } + & Pick + )> } +);