Skip to content

Commit

Permalink
Merge pull request #213 from Telegram-Mini-Apps/bugfix/request-contact
Browse files Browse the repository at this point in the history
Bugfix/request contact
  • Loading branch information
heyqbnk authored Dec 19, 2023
2 parents 4810ac5 + d3c14b7 commit 0905244
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/wicked-kids-unite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tma.js/sdk": patch
---

Fix miniApp.requestContact data parser
2 changes: 1 addition & 1 deletion packages/sdk/src/mini-app/contactParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const contactParser = searchParams<RequestedContact>({
from: 'first_name',
},
lastName: {
type: string(),
type: string().optional(),
from: 'last_name',
},
}),
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/mini-app/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface RequestedContact {
userId: number;
phoneNumber: string;
firstName: string;
lastName: string;
lastName?: string;
};
authDate: Date;
hash: string;
Expand Down

0 comments on commit 0905244

Please sign in to comment.