Skip to content

Commit

Permalink
solve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Sojabio committed Dec 12, 2024
1 parent 5492f34 commit d763148
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 122 deletions.
37 changes: 0 additions & 37 deletions backend/src/resolvers/ArticleResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,7 @@ class NewArticleInput {
@Field(() => String)
productId: number;
}
<<<<<<< HEAD
=======

<<<<<<< HEAD
@InputType()
class EditArticleInput {
@Field()
availability: boolean;
}

>>>>>>> a8da192 (56/delete-article: delete article + reservation if no remaining article)
=======
>>>>>>> 2d5d748 (fix article entity and type bugs)
@Resolver(Article)
class ArticleResolver {
@Query(() => [Article])
Expand All @@ -58,36 +46,12 @@ class ArticleResolver {
return newArticle;
}

<<<<<<< HEAD
<<<<<<< HEAD
@Authorized(Role.Admin)
=======
@Mutation(() => Article)
async editArticle(
@Arg("article") articleId: string,
@Arg("data") newArticleData: EditArticleInput
) {
const article = await Article.findOneByOrFail({
id: Number.parseInt(articleId),
});

article.availability = newArticleData.availability;
const updatedArticle = await article.save();
return updatedArticle;
}

>>>>>>> a8da192 (56/delete-article: delete article + reservation if no remaining article)
=======
@Authorized(Role.Admin)

>>>>>>> 2d5d748 (fix article entity and type bugs)
@Mutation(() => String)
async deleteArticle(@Arg("id") idToDelete: string) {
await Article.delete(idToDelete);
return `Product deleted successfully`;
}
<<<<<<< HEAD
=======

@Mutation(() => Article)
async deleteArticleFromReservation(@Arg("articleId") articleId: string) {
Expand All @@ -110,7 +74,6 @@ class ArticleResolver {

return article;
}
>>>>>>> a8da192 (56/delete-article: delete article + reservation if no remaining article)
}

export default ArticleResolver;
71 changes: 0 additions & 71 deletions frontend/src/generated/graphql-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,7 @@ export type Article = {
__typename?: 'Article';
id: Scalars['Float']['output'];
product: Product;
<<<<<<< HEAD
<<<<<<< HEAD
reservations?: Maybe<Array<Reservation>>;
=======
reservation?: Maybe<Reservation>;
};

export type EditArticleInput = {
availability: Scalars['Boolean']['input'];
>>>>>>> a8da192 (56/delete-article: delete article + reservation if no remaining article)
=======
reservations?: Maybe<Array<Reservation>>;
>>>>>>> 2d5d748 (fix article entity and type bugs)
};

export type Mutation = {
Expand Down Expand Up @@ -283,27 +271,13 @@ export type DeleteArticleMutationVariables = Exact<{

export type DeleteArticleMutation = { __typename?: 'Mutation', deleteArticle: string };

<<<<<<< HEAD
=======
export type DeleteArticleFromReservationMutationVariables = Exact<{
id: Scalars['String']['input'];
}>;


export type DeleteArticleFromReservationMutation = { __typename?: 'Mutation', deleteArticleFromReservation: { __typename?: 'Article', id: number } };

<<<<<<< HEAD
export type EditArticleMutationVariables = Exact<{
data: EditArticleInput;
article: Scalars['String']['input'];
}>;


export type EditArticleMutation = { __typename?: 'Mutation', editArticle: { __typename?: 'Article', id: number, availability: boolean } };

>>>>>>> a8da192 (56/delete-article: delete article + reservation if no remaining article)
=======
>>>>>>> 2d5d748 (fix article entity and type bugs)
export type HandleReservationMutationVariables = Exact<{
data: NewReservationInput;
}>;
Expand Down Expand Up @@ -361,19 +335,15 @@ export type SearchAndFilterProductsQuery = { __typename?: 'Query', searchAndFilt

export type GetCurrentReservationByUserIdQueryVariables = Exact<{ [key: string]: never; }>;

<<<<<<< HEAD
=======

export type GetCurrentReservationByUserIdQuery = { __typename?: 'Query', getCurrentReservationByUserId: { __typename?: 'ReservationWithTotal', totalPrice: number, reservation: { __typename?: 'Reservation', status: string, startDate: any, endDate: any, id: number, createdAt: any, articles: Array<{ __typename?: 'Article', id: number, product: { __typename?: 'Product', name: string, price: number, imgUrl: string } }> } } };

>>>>>>> 2d5d748 (fix article entity and type bugs)
export type GetReservationsByArticleIdQueryVariables = Exact<{
articleId: Scalars['String']['input'];
}>;


export type GetReservationsByArticleIdQuery = { __typename?: 'Query', getReservationsByArticleId: Array<{ __typename?: 'Reservation', id: number, startDate: any, endDate: any, createdAt: any, status: string, articles: Array<{ __typename?: 'Article', id: number, product: { __typename?: 'Product', name: string } }>, user: { __typename?: 'User', email: string } }> };
export type GetCurrentReservationByUserIdQuery = { __typename?: 'Query', getCurrentReservationByUserId: { __typename?: 'ReservationWithTotal', totalPrice: number, reservation: { __typename?: 'Reservation', status: string, startDate: any, endDate: any, id: number, createdAt: any, articles: Array<{ __typename?: 'Article', id: number, availability: boolean, product: { __typename?: 'Product', name: string, price: number, imgUrl: string } }> } } };


export const CreateNewProductDocument = gql`
Expand Down Expand Up @@ -659,8 +629,6 @@ export function useDeleteArticleMutation(baseOptions?: Apollo.MutationHookOption
export type DeleteArticleMutationHookResult = ReturnType<typeof useDeleteArticleMutation>;
export type DeleteArticleMutationResult = Apollo.MutationResult<DeleteArticleMutation>;
export type DeleteArticleMutationOptions = Apollo.BaseMutationOptions<DeleteArticleMutation, DeleteArticleMutationVariables>;
<<<<<<< HEAD
=======
export const DeleteArticleFromReservationDocument = gql`
mutation DeleteArticleFromReservation($id: String!) {
deleteArticleFromReservation(articleId: $id) {
Expand Down Expand Up @@ -694,45 +662,6 @@ export function useDeleteArticleFromReservationMutation(baseOptions?: Apollo.Mut
export type DeleteArticleFromReservationMutationHookResult = ReturnType<typeof useDeleteArticleFromReservationMutation>;
export type DeleteArticleFromReservationMutationResult = Apollo.MutationResult<DeleteArticleFromReservationMutation>;
export type DeleteArticleFromReservationMutationOptions = Apollo.BaseMutationOptions<DeleteArticleFromReservationMutation, DeleteArticleFromReservationMutationVariables>;
<<<<<<< HEAD
export const EditArticleDocument = gql`
mutation EditArticle($data: EditArticleInput!, $article: String!) {
editArticle(data: $data, article: $article) {
id
availability
}
}
`;
export type EditArticleMutationFn = Apollo.MutationFunction<EditArticleMutation, EditArticleMutationVariables>;

/**
* __useEditArticleMutation__
*
* To run a mutation, you first call `useEditArticleMutation` within a React component and pass it any options that fit your needs.
* When your component renders, `useEditArticleMutation` returns a tuple that includes:
* - A mutate function that you can call at any time to execute the mutation
* - An object with fields that represent the current status of the mutation's execution
*
* @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
*
* @example
* const [editArticleMutation, { data, loading, error }] = useEditArticleMutation({
* variables: {
* data: // value for 'data'
* article: // value for 'article'
* },
* });
*/
export function useEditArticleMutation(baseOptions?: Apollo.MutationHookOptions<EditArticleMutation, EditArticleMutationVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<EditArticleMutation, EditArticleMutationVariables>(EditArticleDocument, options);
}
export type EditArticleMutationHookResult = ReturnType<typeof useEditArticleMutation>;
export type EditArticleMutationResult = Apollo.MutationResult<EditArticleMutation>;
export type EditArticleMutationOptions = Apollo.BaseMutationOptions<EditArticleMutation, EditArticleMutationVariables>;
>>>>>>> a8da192 (56/delete-article: delete article + reservation if no remaining article)
=======
>>>>>>> 2d5d748 (fix article entity and type bugs)
export const HandleReservationDocument = gql`
mutation HandleReservation($data: NewReservationInput!) {
handleReservation(data: $data) {
Expand Down
14 changes: 0 additions & 14 deletions frontend/src/graphql/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ export const DELETE_ARTICLE = gql`
}
`;

<<<<<<< HEAD
=======
export const DELETE_ARTICLE_FROM_RESERVATION = gql`
mutation DeleteArticleFromReservation($id: String!) {
deleteArticleFromReservation(articleId: $id) {
Expand All @@ -93,18 +91,6 @@ export const DELETE_ARTICLE_FROM_RESERVATION = gql`
}
`;

<<<<<<< HEAD
export const EDIT_ARTICLE = gql`
mutation EditArticle($data: EditArticleInput!, $article: String!) {
editArticle(data: $data, article: $article) {
id
availability
}
}
`;
>>>>>>> a8da192 (56/delete-article: delete article + reservation if no remaining article)
=======
>>>>>>> 2d5d748 (fix article entity and type bugs)
export const HANDLE_RESERVATION = gql`
mutation HandleReservation($data: NewReservationInput!) {
handleReservation(data: $data) {
Expand Down

0 comments on commit d763148

Please sign in to comment.