fix lint errors

This commit is contained in:
Shahed Nasser
2024-12-11 11:20:07 +02:00
parent 3522c0f0e0
commit 35a8224497
9 changed files with 51 additions and 51 deletions
@@ -695,17 +695,17 @@ export const syncStep = createStep(
const sanityModule: SanityModuleService = container.resolve(SANITY_MODULE)
const query = container.resolve(ContainerRegistrationKeys.QUERY)
let total = 0;
const total = 0
const upsertMap: {
before: any
after: any
}[] = []
const batchSize = 200;
let hasMore = true;
let offset = 0;
let filters = input.product_ids ? {
id: input.product_ids
const batchSize = 200
const hasMore = true
const offset = 0
const filters = input.product_ids ? {
id: input.product_ids,
} : {}
while (hasMore) {
@@ -772,16 +772,16 @@ while (hasMore) {
const after = await sanityModule.upsertSyncDocument(
"product",
prod as ProductDTO
);
)
upsertMap.push({
// @ts-ignore
before: prod.sanity_product,
after
after,
})
return after
}),
})
)
} catch (e) {
return StepResponse.permanentFailure(
@@ -805,7 +805,7 @@ You also wrap the `promiseAll` function within a try-catch block. In the catch b
Finally, after the `while` loop and at the end of the step, add the following return statement:
```ts title="src/workflows/sanity-sync-products/steps/sync.ts"
return new StepResponse({ total }, upsertMap);
return new StepResponse({ total }, upsertMap)
```
If no errors occur, the step returns an instance of `StepResponse`, which must be returned by any step. It accepts as a first parameter the data to return to the workflow that executed this step.