mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2025-04-13 09:44:40 +00:00
implement /api/v1/bookmarks
This commit is contained in:
parent
cac8377e4e
commit
aaf49eadee
1 changed files with 27 additions and 5 deletions
|
@ -657,16 +657,38 @@ export default class Misskey implements MegalodonInterface {
|
|||
// ======================================
|
||||
// accounts/bookmarks
|
||||
// ======================================
|
||||
public async getBookmarks(_options?: {
|
||||
/**
|
||||
* POST /api/i/favorites
|
||||
*/
|
||||
public async getBookmarks(options?: {
|
||||
limit?: number
|
||||
max_id?: string
|
||||
since_id?: string
|
||||
min_id?: string
|
||||
}): Promise<Response<Array<Entity.Status>>> {
|
||||
return new Promise((_, reject) => {
|
||||
const err = new NoImplementedError('misskey does not support')
|
||||
reject(err)
|
||||
})
|
||||
let params = {}
|
||||
if (options) {
|
||||
if (options.limit) {
|
||||
params = Object.assign(params, {
|
||||
limit: options.limit
|
||||
})
|
||||
}
|
||||
if (options.max_id) {
|
||||
params = Object.assign(params, {
|
||||
untilId: options.max_id
|
||||
})
|
||||
}
|
||||
if (options.min_id) {
|
||||
params = Object.assign(params, {
|
||||
sinceId: options.min_id
|
||||
})
|
||||
}
|
||||
}
|
||||
return this.client.post<Array<MisskeyAPI.Entity.Favorite>>('/api/i/favorites', params).then(res => {
|
||||
return Object.assign(res, {
|
||||
data: res.data.map(fav => MisskeyAPI.Converter.note(fav.note, this.baseUrl))
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// ======================================
|
||||
|
|
Loading…
Add table
Reference in a new issue