about summary refs log tree commit diff
path: root/src/state/lib/api.ts
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2022-09-07 16:00:25 -0500
committerPaul Frazee <pfrazee@gmail.com>2022-09-07 16:00:25 -0500
commit9010078489eae77c620a3bf4802ff6b417ea31f9 (patch)
tree11c5c03099a5cda82161d077efd3d50525dd8487 /src/state/lib/api.ts
parent5ae39612d7e8484ffc5be6c7c5dc0f878985c676 (diff)
downloadvoidsky-9010078489eae77c620a3bf4802ff6b417ea31f9.tar.zst
Add EditProfile modal
Diffstat (limited to 'src/state/lib/api.ts')
-rw-r--r--src/state/lib/api.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/state/lib/api.ts b/src/state/lib/api.ts
index 64a88cdec..3324525bf 100644
--- a/src/state/lib/api.ts
+++ b/src/state/lib/api.ts
@@ -124,6 +124,17 @@ export async function unfollow(
   return numDels > 0
 }
 
+export async function updateProfile(
+  adx: AdxClient,
+  user: string,
+  profile: bsky.Profile.Record,
+) {
+  return await adx
+    .repo(user, true)
+    .collection('blueskyweb.xyz:Profiles')
+    .put('Profile', 'profile', {$type: 'blueskyweb.xyz:Profile', ...profile})
+}
+
 type WherePred = (_record: GetRecordResponseValidated) => Boolean
 async function deleteWhere(
   coll: AdxRepoCollectionClient,