Add post deletion
This commit is contained in:
parent
bd1a4b198e
commit
41ae87e770
8 changed files with 114 additions and 9 deletions
|
@ -1,6 +1,7 @@
|
|||
import {makeAutoObservable, runInAction} from 'mobx'
|
||||
import * as GetTimeline from '../../third-party/api/src/client/types/app/bsky/feed/getTimeline'
|
||||
import * as GetAuthorFeed from '../../third-party/api/src/client/types/app/bsky/feed/getAuthorFeed'
|
||||
import {AtUri} from '../../third-party/uri'
|
||||
import {RootStoreModel} from './root-store'
|
||||
import * as apilib from '../lib/api'
|
||||
import {cleanError} from '../../view/lib/strings'
|
||||
|
@ -135,6 +136,13 @@ export class FeedItemModel implements GetTimeline.FeedItem {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
async delete() {
|
||||
await this.rootStore.api.app.bsky.feed.post.delete({
|
||||
did: this.author.did,
|
||||
rkey: new AtUri(this.uri).rkey,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class FeedModel {
|
||||
|
|
|
@ -175,6 +175,13 @@ export class PostThreadViewPostModel implements GetPostThread.Post {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
async delete() {
|
||||
await this.rootStore.api.app.bsky.feed.post.delete({
|
||||
did: this.author.did,
|
||||
rkey: new AtUri(this.uri).rkey,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class PostThreadViewModel {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue