Skip to content

Commit

Permalink
Upgrade orval and Execute yarn codegen:client:dpl-cms
Browse files Browse the repository at this point in the history
This upgrade was necessary because `orval` did not correctly capitalize (uppercase) the HTTP request methods. Additionally, I plan to run the codegen for the other `orval` clients in separate commits following this one. These will include:
- "codegen:client:fbs"
- "codegen:client:cover"
- "codegen:client:publizon"
  • Loading branch information
kasperbirch1 committed Apr 4, 2024
1 parent 7a3f07c commit baccd3f
Show file tree
Hide file tree
Showing 54 changed files with 1,127 additions and 1,381 deletions.
5 changes: 4 additions & 1 deletion docs/campaigns.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ look something like this:
if (campaignFacets) {
mutate(
{
data: campaignFacets as CampaignMatchPOSTBodyItem[]
data: campaignFacets as CampaignMatchPOSTBodyItem[],
params: {
_format: "json"
}
},
{
onSuccess: (campaign) => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
"graphql": "^16.8.1",
"graphql-tag": "^2.12.6",
"lodash": "^4.17.21",
"orval": "^6.8.1",
"orval": "^6.26.0",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-device-detect": "^2.2.3",
Expand Down
27 changes: 23 additions & 4 deletions src/apps/opening-hours-editor/useOpeningHours.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ const useOpeningHours = () => {
}, [openingHoursData]);

const onSuccess = () => {
queryClient.invalidateQueries(getDplOpeningHoursListGETQueryKey());
queryClient.invalidateQueries(
getDplOpeningHoursListGETQueryKey({ branch_id: openingHoursBranchId })
);
};

const onError = (message: string) => {
Expand All @@ -47,7 +49,13 @@ const useOpeningHours = () => {
const handleEventAdd = (event: DplOpeningHoursListGET200Item) => {
createOpeningHours(
{
data: event
data: {
...event,
branch_id: openingHoursBranchId
},
params: {
_format: "json"
}
},
{
onSuccess: () => {
Expand All @@ -64,7 +72,13 @@ const useOpeningHours = () => {
updateOpeningHours(
{
id: event.id.toString(),
data: event
data: {
...event,
branch_id: openingHoursBranchId
},
params: {
_format: "json"
}
},
{
onSuccess: () => {
Expand All @@ -79,7 +93,12 @@ const useOpeningHours = () => {

const handleEventRemove = (eventId: string) => {
removeOpeningHours(
{ id: eventId },
{
id: eventId,
params: {
_format: "json"
}
},
{
onSuccess: () => {
onSuccess();
Expand Down
5 changes: 4 additions & 1 deletion src/apps/search-result/search-result.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ const SearchResult: React.FC<SearchResultProps> = ({ q, pageSize }) => {
if (campaignFacets) {
mutate(
{
data: campaignFacets as CampaignMatchPOSTBodyItem[]
data: campaignFacets as CampaignMatchPOSTBodyItem[],
params: {
_format: "json"
}
},
{
onSuccess: (campaign) => {
Expand Down
Loading

0 comments on commit baccd3f

Please sign in to comment.