You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by Samuel-Morgan-Tyghe July 1, 2024
So theres alot of uses for passing in hardcoded values to our fake data, but to utilize this we then have to pass it into a handler.
why not pass data directly into the handler into the handler?
import { http } from "msw";
import { createGetProductSummaryMutationResponse } from "../../mocks/retail/createGetProductSummary";
export const getProductSummaryHandler = (extendedData) => http.post("*/v2/products/summary", function handler() {
return new Response(JSON.stringify(createGetProductSummaryMutationResponse(extendedData)), {
headers: {
"Content-Type": "application/json",
},
});
});
export function createGetProductSummaryMutationResponse(extendedData): NonNullable<GetProductSummaryMutationResponse> {
faker.seed([100]);
return createProductSummary(extendedData);
}
The text was updated successfully, but these errors were encountered:
@cthompson-avb And how would you provide your static data? The only thing I can think of is something like this:
This means the data needs to be provided in every handler. As in, defining the data will be outside of Kubb.
Discussed in #1062
Originally posted by Samuel-Morgan-Tyghe July 1, 2024
So theres alot of uses for passing in hardcoded values to our fake data, but to utilize this we then have to pass it into a handler.
why not pass data directly into the handler into the handler?
The text was updated successfully, but these errors were encountered: