diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/state/lib/api.ts | 12 | ||||
-rw-r--r-- | src/state/models/profile-view.ts | 6 |
2 files changed, 14 insertions, 4 deletions
diff --git a/src/state/lib/api.ts b/src/state/lib/api.ts index 701475532..9bc19b78c 100644 --- a/src/state/lib/api.ts +++ b/src/state/lib/api.ts @@ -111,12 +111,18 @@ export async function unrepost(store: RootStoreModel, repostUri: string) { }) } -export async function follow(store: RootStoreModel, subject: string) { - // TODO NOW needs update +export async function follow( + store: RootStoreModel, + subjectDid: string, + subjectDeclarationCid: string, +) { return await store.api.app.bsky.graph.follow.create( {did: store.me.did || ''}, { - subject, + subject: { + did: subjectDid, + declarationCid: subjectDeclarationCid, + }, createdAt: new Date().toISOString(), }, ) diff --git a/src/state/models/profile-view.ts b/src/state/models/profile-view.ts index 4df338fc0..a64c07339 100644 --- a/src/state/models/profile-view.ts +++ b/src/state/models/profile-view.ts @@ -98,7 +98,11 @@ export class ProfileViewModel { this.myState.follow = undefined }) } else { - const res = await apilib.follow(this.rootStore, this.did) + const res = await apilib.follow( + this.rootStore, + this.did, + this.declaration.cid, + ) runInAction(() => { this.followersCount++ this.myState.follow = res.uri |