Skip to content
This repository has been archived by the owner on May 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #347 from frameless/feature/HP-149/remove-witness
Browse files Browse the repository at this point in the history
feature/HP-149/remove-witness
  • Loading branch information
remko48 authored May 5, 2023
2 parents 95edc19 + 91e52fa commit ce243a3
Show file tree
Hide file tree
Showing 5 changed files with 6,439 additions and 6,815 deletions.
8 changes: 3 additions & 5 deletions pages/trouw-opties/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@ const BlogPost: NextPage = () => {
setIsLoading(true);

SdgproductService.sdgproductGetItem(marriageOptions.type)
.then((res) => {
.then((res: any) => {
setCeremonyTypes(
// @ts-ignore
res.embedded.gerelateerdeProducten.map((ceremony: any) => ({
name: ceremony.upnLabel,
id: ceremony._self.id,
Expand All @@ -92,9 +91,8 @@ const BlogPost: NextPage = () => {
"PT2H",
format(endDate, "yyyy-MM-dd"),
selectedDate
).then((res) => {
// @ts-ignore
setAvailableSlots(JSON.parse(res)[selectedDate].filter((slot: any) => slot.resources.length > 0));
).then((res: any) => {
setAvailableSlots(res[selectedDate].filter((slot: any) => slot.resources.length > 0));
});
}, [ceremonyTypes, selectedDate]);

Expand Down
5 changes: 2 additions & 3 deletions pages/trouw-opties/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ export default function MultistepForm1() {
setIsLoading(true);

SdgproductService.sdgproductGetCollection(undefined, undefined, undefined, weddingOptions)
.then((res) => {
// @ts-ignore
.then((res: any) => {
setMarriageOptions({ ...marriageOptions, type: res.results[0].id });
replace(`/trouw-opties/${weddingOptions}`);
})
Expand Down Expand Up @@ -107,7 +106,7 @@ export default function MultistepForm1() {
<Button
type="submit"
name="type"
value="geregistreerd-partnerschap"
value="partnerschap"
appearance="primary-action-button"
onClick={onWeddingOptionsClick}
disabled={isLoading}
Expand Down
9 changes: 3 additions & 6 deletions pages/voorgenomen-huwelijk/betalen/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,10 @@ const Betalen: NextPage = () => {
undefined,
undefined,
marriageOptions.huwelijk.id
).then((res) => {
// @ts-ignore
const json = JSON.parse(res);
).then((res: any) => {
const path = new URL(res.redirectUrl).pathname;

const path = new URL(json.redirectUrl).pathname;

push(`${path}?paymentId=${json.paymentId}`);
push(`${path}?paymentId=${res.paymentId}`);
});
};

Expand Down
18 changes: 18 additions & 0 deletions pages/voorgenomen-huwelijk/betalen/succes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,21 @@ export default function HuwelijksplannerStep0() {
} as Assent).finally(() => setIsLoading(false));
};

const removeWitness = () => {
setIsLoading(true);

// @ts-ignore
AssentService.assentPatchItem(witness.id, {
huwelijk: null,
} as Assent)
.then(() =>
HuwelijkService.huwelijkGetItem(marriageOptions.huwelijk.id).then((res) => {
setHuwelijk(res);
})
)
.finally(() => setIsLoading(false));
};

return (
<DataList className="utrecht-data-list--grid">
<DataListItem>
Expand All @@ -255,6 +270,9 @@ export default function HuwelijksplannerStep0() {
<Button disabled={isLoading || !name} onClick={handleNameChange}>
Update name
</Button>
<Button disabled={isLoading} onClick={removeWitness}>
Remove
</Button>
</DataListActions>
</DataListItem>
<DataListItem>
Expand Down
Loading

1 comment on commit ce243a3

@vercel
Copy link

@vercel vercel bot commented on ce243a3 May 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.