diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-06-02 15:01:04 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-02 15:01:04 -0500 |
commit | e8843ded5bf1f3d97b735ffe8f8553de46f9b18b (patch) | |
tree | 9c94613890fdc5428875dede148a5dd48e1c21a3 /src/state/models/content/list-membership.ts | |
parent | 46c9de7c1865a57d2fef926db2d923a8687eca18 (diff) | |
download | voidsky-e8843ded5bf1f3d97b735ffe8f8553de46f9b18b.tar.zst |
Fix a bunch of type errors and add a type-check to the github workflows (#837)
* Add yarn type-check * Rename to yarn typecheck * Fix a collection of type errors * Add typecheck to automated tests * add `dist` to exluded folders tsconfig --------- Co-authored-by: Ansh Nanda <anshnanda10@gmail.com>
Diffstat (limited to 'src/state/models/content/list-membership.ts')
-rw-r--r-- | src/state/models/content/list-membership.ts | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/state/models/content/list-membership.ts b/src/state/models/content/list-membership.ts index b4af4472b..20d9b60af 100644 --- a/src/state/models/content/list-membership.ts +++ b/src/state/models/content/list-membership.ts @@ -9,6 +9,16 @@ interface Membership { value: AppBskyGraphListitem.Record } +interface ListitemRecord { + uri: string + value: AppBskyGraphListitem.Record +} + +interface ListitemListResponse { + cursor?: string + records: ListitemRecord[] +} + export class ListMembershipModel { // data memberships: Membership[] = [] @@ -32,13 +42,14 @@ export class ListMembershipModel { // it needs to be replaced with server side list membership queries // -prf let cursor - let records = [] + let records: ListitemRecord[] = [] for (let i = 0; i < 100; i++) { - const res = await this.rootStore.agent.app.bsky.graph.listitem.list({ - repo: this.rootStore.me.did, - cursor, - limit: PAGE_SIZE, - }) + const res: ListitemListResponse = + await this.rootStore.agent.app.bsky.graph.listitem.list({ + repo: this.rootStore.me.did, + cursor, + limit: PAGE_SIZE, + }) records = records.concat( res.records.filter(record => record.value.subject === this.subject), ) @@ -99,7 +110,7 @@ export class ListMembershipModel { }) } - async updateTo(uris: string) { + async updateTo(uris: string[]) { for (const uri of uris) { await this.add(uri) } |