@vtex/faststore-plugin-buyer-portal 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtex/faststore-plugin-buyer-portal",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "A plugin for faststore with buyer portal",
5
5
  "main": "index.js",
6
6
  "dependencies": {
@@ -9,12 +9,14 @@ import { useRouter } from "next/router";
9
9
 
10
10
  export type AddRecipientsDrawerProps = Omit<BasicDrawerProps, "children"> & {
11
11
  readonly?: boolean;
12
+ addressId?: string;
12
13
  refetchRecipients: () => void;
13
14
  };
14
15
 
15
16
  export const AddRecipientsDrawer = ({
16
17
  close,
17
18
  refetchRecipients,
19
+ addressId,
18
20
  readonly,
19
21
  ...props
20
22
  }: AddRecipientsDrawerProps) => {
@@ -47,7 +49,7 @@ export const AddRecipientsDrawer = ({
47
49
  addRecipientsToAddress({
48
50
  recipients,
49
51
  contractId: router.query.contractId as string,
50
- addressId: router.query.addressId as string,
52
+ addressId: addressId ?? (router.query.addressId as string),
51
53
  });
52
54
  }
53
55
  };
@@ -10,6 +10,7 @@ import {
10
10
  import { useDrawerProps, useBuyerPortal } from "../../../shared/hooks";
11
11
  import { BasicDropdownMenu, Icon } from "../../../shared/components";
12
12
  import type { AddressData } from "../../types";
13
+ import { useRouter } from "next/router";
13
14
 
14
15
  export type AddressDropdownMenuProps = {
15
16
  currentAddress: AddressData;
@@ -22,6 +23,7 @@ export const AddressDropdownMenu = ({
22
23
  currentAddress,
23
24
  }: AddressDropdownMenuProps) => {
24
25
  const { currentOrgUnit } = useBuyerPortal();
26
+ const router = useRouter();
25
27
 
26
28
  const idsPath = currentOrgUnit?.path?.ids?.split("/") ?? [];
27
29
 
@@ -114,6 +116,8 @@ export const AddressDropdownMenu = ({
114
116
  readonly
115
117
  {...recipientDrawerProps}
116
118
  isOpen={isOpenRecipientsDrawer}
119
+ refetchRecipients={() => router.reload()}
120
+ addressId={currentAddress.id}
117
121
  />
118
122
  )}
119
123
  {isOpenRemoveAddressDrawer && (