Skip to content

Commit

Permalink
feat: edit phone number support
Browse files Browse the repository at this point in the history
  • Loading branch information
MuhammedKpln committed Aug 20, 2024
1 parent 21693a9 commit d91d038
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
Binary file modified bun.lockb
Binary file not shown.
4 changes: 4 additions & 0 deletions lib/modules/settings/profile/profile_section.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Card, H6, Separator, YGroup } from 'tamagui';
import LogoutItem from './items/logout_item';
import PhoneItem from './items/phone_item';
import TwitterItem from './items/twitter_item';

export default function SettingsProfileSection() {
Expand All @@ -12,6 +13,9 @@ export default function SettingsProfileSection() {
<YGroup.Item>
<TwitterItem />
</YGroup.Item>
<YGroup.Item>
<PhoneItem />
</YGroup.Item>
<YGroup.Item>
<LogoutItem />
</YGroup.Item>
Expand Down
14 changes: 14 additions & 0 deletions lib/services/profile.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,20 @@ class ProfileService extends BaseService {
return data;
}

async updatePhoneNumber(userUid: string, number: string) {
const { error } = await this.client.from('phone_numbers').upsert(
{
id: userUid,
number: number
},
{ onConflict: 'id' }
);

if (error) {
throw error;
}
}

async fetchProfile(userUid: string) {
const profileQuery = this.client
.from('profiles')
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"expo-system-ui": "~3.0.7",
"expo-web-browser": "~13.0.3",
"immer": "^10.0.4",
"libphonenumber-js": "^1.11.7",
"mime": "^4.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down

0 comments on commit d91d038

Please sign in to comment.