Skip to content

Commit

Permalink
Fix a typo in Admin Generator and Demo (#1754)
Browse files Browse the repository at this point in the history
Changed `mutationReponse` to `mutationResponse` in admin generator and
in demo files.

---------

Co-authored-by: Phillip Lechenauer <phillip.lechenauer@vivid-planet.com>
  • Loading branch information
Flips2001 and Phillip Lechenauer authored Feb 26, 2024
1 parent cef3964 commit 9f9c160
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions demo/admin/src/news/generated/NewsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ export function NewsForm({ id }: FormProps): React.ReactElement {
variables: { id, input: output, lastUpdatedAt: data?.news?.updatedAt },
});
} else {
const { data: mutationReponse } = await client.mutate<GQLCreateNewsMutation, GQLCreateNewsMutationVariables>({
const { data: mutationResponse } = await client.mutate<GQLCreateNewsMutation, GQLCreateNewsMutationVariables>({
mutation: createNewsMutation,
variables: { scope, input: output },
});
if (!event.navigatingBack) {
const id = mutationReponse?.createNews.id;
const id = mutationResponse?.createNews.id;
if (id) {
setTimeout(() => {
stackSwitchApi.activatePage("edit", id);
Expand Down
4 changes: 2 additions & 2 deletions demo/admin/src/products/ProductForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ function ProductForm({ id }: FormProps): React.ReactElement {
variables: { id, input: output, lastUpdatedAt: data?.product.updatedAt },
});
} else {
const { data: mutationReponse } = await client.mutate<GQLCreateProductMutation, GQLCreateProductMutationVariables>({
const { data: mutationResponse } = await client.mutate<GQLCreateProductMutation, GQLCreateProductMutationVariables>({
mutation: createProductMutation,
variables: { input: output },
});
if (!event.navigatingBack) {
const id = mutationReponse?.createProduct.id;
const id = mutationResponse?.createProduct.id;
if (id) {
setTimeout(() => {
stackSwitchApi.activatePage(`edit`, id);
Expand Down
4 changes: 2 additions & 2 deletions demo/admin/src/products/categories/ProductCategoryForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ function ProductCategoryForm({ id }: FormProps): React.ReactElement {
variables: { id, input: output, lastUpdatedAt: data?.productCategory.updatedAt },
});
} else {
const { data: mutationReponse } = await client.mutate<
const { data: mutationResponse } = await client.mutate<
GQLProductCategoryFormCreateProductCategoryMutation,
GQLProductCategoryFormCreateProductCategoryMutationVariables
>({
mutation: createProductCategoryMutation,
variables: { input: output },
});
if (!event.navigatingBack) {
const id = mutationReponse?.createProductCategory.id;
const id = mutationResponse?.createProductCategory.id;
if (id) {
setTimeout(() => {
stackSwitchApi.activatePage(`edit`, id);
Expand Down
4 changes: 2 additions & 2 deletions demo/admin/src/products/generated/ProductForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ export function ProductForm({ id }: FormProps): React.ReactElement {
variables: { id, input: output, lastUpdatedAt: data?.product?.updatedAt },
});
} else {
const { data: mutationReponse } = await client.mutate<GQLCreateProductMutation, GQLCreateProductMutationVariables>({
const { data: mutationResponse } = await client.mutate<GQLCreateProductMutation, GQLCreateProductMutationVariables>({
mutation: createProductMutation,
variables: { input: output },
});
if (!event.navigatingBack) {
const id = mutationReponse?.createProduct.id;
const id = mutationResponse?.createProduct.id;
if (id) {
setTimeout(() => {
stackSwitchApi.activatePage("edit", id);
Expand Down
4 changes: 2 additions & 2 deletions demo/admin/src/products/tags/ProductTagForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ function ProductTagForm({ id }: FormProps): React.ReactElement {
variables: { id, input: output, lastUpdatedAt: data?.productTag.updatedAt },
});
} else {
const { data: mutationReponse } = await client.mutate<
const { data: mutationResponse } = await client.mutate<
GQLProductTagFormCreateProductTagMutation,
GQLProductTagFormCreateProductTagMutationVariables
>({
mutation: createProductTagMutation,
variables: { input: output },
});
if (!event.navigatingBack) {
const id = mutationReponse?.createProductTag.id;
const id = mutationResponse?.createProductTag.id;
if (id) {
setTimeout(() => {
stackSwitchApi.activatePage(`edit`, id);
Expand Down
4 changes: 2 additions & 2 deletions packages/admin/cms-admin/src/generator/generateForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,12 @@ export async function writeCrudForm(generatorConfig: CrudGeneratorConfig, schema
variables: { id, input: output, lastUpdatedAt: data?.${instanceEntityName}?.updatedAt },
});
} else {
const { data: mutationReponse } = await client.mutate<GQLCreate${entityName}Mutation, GQLCreate${entityName}MutationVariables>({
const { data: mutationResponse } = await client.mutate<GQLCreate${entityName}Mutation, GQLCreate${entityName}MutationVariables>({
mutation: create${entityName}Mutation,
variables: { ${hasScope ? `scope, ` : ""}input: output },
});
if (!event.navigatingBack) {
const id = mutationReponse?.create${entityName}.id;
const id = mutationResponse?.create${entityName}.id;
if (id) {
setTimeout(() => {
stackSwitchApi.activatePage("edit", id);
Expand Down

0 comments on commit 9f9c160

Please sign in to comment.