Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add Sanity integration guide #10152

Merged
merged 5 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions www/apps/resources/.content.eslintrc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ export default [
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-non-null-asserted-optional-chain": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-unused-expressions": "warn",
},
},
]
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ Create the file `src/modules/my-event/service.ts` that holds the implementation
The Event Module's main service must extend the `AbstractEventBusModuleService` class imported from `@medusajs/framework/utils`:

```ts title="src/modules/my-event/service.ts"
import { AbstractEventBusModuleService } from "@medusajs/framework/utils";
import { Message } from "@medusajs/types";
import { AbstractEventBusModuleService } from "@medusajs/framework/utils"
import { Message } from "@medusajs/types"

class MyEventService extends AbstractEventBusModuleService {
async emit<T>(data: Message<T> | Message<T>[], options: Record<string, unknown>): Promise<void> {
throw new Error("Method not implemented.");
throw new Error("Method not implemented.")
}
async releaseGroupedEvents(eventGroupId: string): Promise<void> {
throw new Error("Method not implemented.");
throw new Error("Method not implemented.")
}
async clearGroupedEvents(eventGroupId: string): Promise<void> {
throw new Error("Method not implemented.");
throw new Error("Method not implemented.")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,8 @@ export const deleteManagerWorkflow = createWorkflow(
app_metadata: {
// the ID is of the format `{actor_type}_id`.
manager_id: input.id,
}
}
},
},
})

const authIdentity = transform(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,8 @@ export const updateCustomFromCartWorkflow = createWorkflow(
entity: "cart",
fields: ["custom.*"],
filters: {
id: input.cart.id
}
id: input.cart.id,
},
})

// TODO create, update, or delete Custom record
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ export const updateCustomFromCustomerWorkflow = createWorkflow(
fields: ["custom.*"],
filters: {
id: input.customer.id,
}
},
})

// TODO create, update, or delete Custom record
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ export const updateCustomFromProductWorkflow = createWorkflow(
fields: ["custom.*"],
filters: {
id: input.product.id,
}
},
})

// TODO create, update, or delete Custom record
Expand All @@ -549,7 +549,7 @@ Next, replace the `TODO` with the following:
```ts title="src/workflows/update-custom-from-product/index.ts"
const created = when({
input,
products
products,
}, (data) =>
!data.products[0].custom &&
data.input.additional_data?.custom_name?.length > 0
Expand Down Expand Up @@ -583,7 +583,7 @@ Next, replace the new `TODO` with the following:
```ts title="src/workflows/update-custom-from-product/index.ts"
const deleted = when({
input,
products
products,
}, (data) =>
data.products[0].custom && (
data.input.additional_data?.custom_name === null ||
Expand All @@ -592,13 +592,13 @@ const deleted = when({
)
.then(() => {
deleteCustomStep({
custom: products[0].custom
custom: products[0].custom,
})

dismissRemoteLinkStep({
[HELLO_MODULE]: {
custom_id: products[0].custom.id
}
custom_id: products[0].custom.id,
},
})

return products[0].custom.id
Expand All @@ -614,12 +614,12 @@ Finally, replace the new `TODO` with the following:
```ts title="src/workflows/update-custom-from-product/index.ts"
const updated = when({
input,
products
products,
}, (data) => data.products[0].custom && data.input.additional_data?.custom_name?.length > 0)
.then(() => {
const custom = updateCustomStep({
id: products[0].custom.id,
custom_name: input.additional_data.custom_name
custom_name: input.additional_data.custom_name,
})

return custom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ export const updateCustomFromPromotionWorkflow = createWorkflow(
fields: ["custom.*"],
filters: {
id: input.promotion.id,
}
},
})

// TODO create, update, or delete Custom record
Expand All @@ -555,7 +555,7 @@ Next, replace the `TODO` with the following:
```ts title="src/workflows/update-custom-from-promotion/index.ts"
const created = when({
input,
promotions
promotions,
}, (data) =>
!data.promotions[0].custom &&
data.input.additional_data?.custom_name?.length > 0
Expand Down Expand Up @@ -589,7 +589,7 @@ Next, replace the new `TODO` with the following:
```ts title="src/workflows/update-custom-from-promotion/index.ts"
const deleted = when({
input,
promotions
promotions,
}, (data) =>
data.promotions[0].custom && (
data.input.additional_data?.custom_name === null ||
Expand All @@ -598,13 +598,13 @@ const deleted = when({
)
.then(() => {
deleteCustomStep({
custom: promotions[0].custom
custom: promotions[0].custom,
})

dismissRemoteLinkStep({
[HELLO_MODULE]: {
custom_id: promotions[0].custom.id
}
custom_id: promotions[0].custom.id,
},
})

return promotions[0].custom.id
Expand All @@ -620,12 +620,12 @@ Finally, replace the new `TODO` with the following:
```ts title="src/workflows/update-custom-from-promotion/index.ts"
const updated = when({
input,
promotions
promotions,
}, (data) => data.promotions[0].custom && data.input.additional_data?.custom_name?.length > 0)
.then(() => {
const custom = updateCustomStep({
id: promotions[0].custom.id,
custom_name: input.additional_data.custom_name
custom_name: input.additional_data.custom_name,
})

return custom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ export const languages: Language[] = [
code: "da",
display_name: "Danish",
ltr: true,
date_locale: da
}
date_locale: da,
},
]
```

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading