From 29c47c6fdeb1351e09c2252211720ebbd70b30d5 Mon Sep 17 00:00:00 2001 From: Vladislav Kibenko Date: Tue, 19 Dec 2023 22:59:07 +0300 Subject: [PATCH 1/3] fix(sdk): make lastName optional in requestContact result --- packages/sdk/src/mini-app/contactParser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sdk/src/mini-app/contactParser.ts b/packages/sdk/src/mini-app/contactParser.ts index 16a15b39d..34958b82c 100644 --- a/packages/sdk/src/mini-app/contactParser.ts +++ b/packages/sdk/src/mini-app/contactParser.ts @@ -17,7 +17,7 @@ export const contactParser = searchParams({ from: 'first_name', }, lastName: { - type: string(), + type: string().optional(), from: 'last_name', }, }), From 384f72253ef75dd10ca50c2e6f7c393fa84a8e49 Mon Sep 17 00:00:00 2001 From: Vladislav Kibenko Date: Tue, 19 Dec 2023 23:06:23 +0300 Subject: [PATCH 2/3] fix(sdk): make lastName optional in RequestedContact --- packages/sdk/src/mini-app/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sdk/src/mini-app/types.ts b/packages/sdk/src/mini-app/types.ts index ef370e003..820a0ba0d 100644 --- a/packages/sdk/src/mini-app/types.ts +++ b/packages/sdk/src/mini-app/types.ts @@ -31,7 +31,7 @@ export interface RequestedContact { userId: number; phoneNumber: string; firstName: string; - lastName: string; + lastName?: string; }; authDate: Date; hash: string; From d3c14b73a9f1ceda8724a04fe7bc710c052cd77d Mon Sep 17 00:00:00 2001 From: Vladislav Kibenko Date: Tue, 19 Dec 2023 23:07:58 +0300 Subject: [PATCH 3/3] docs(changeset): Fix miniApp.requestContact data parser --- .changeset/wicked-kids-unite.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/wicked-kids-unite.md diff --git a/.changeset/wicked-kids-unite.md b/.changeset/wicked-kids-unite.md new file mode 100644 index 000000000..dc0322023 --- /dev/null +++ b/.changeset/wicked-kids-unite.md @@ -0,0 +1,5 @@ +--- +"@tma.js/sdk": patch +--- + +Fix miniApp.requestContact data parser