pinafore/routes/_actions/statuses.js

22 lines
798 B
JavaScript
Raw Normal View History

import { database } from '../_database/database'
2018-02-17 04:38:21 +01:00
export async function getIdThatThisStatusReblogged (instanceName, statusId) {
let status = await database.getStatus(instanceName, statusId)
2018-02-17 04:38:21 +01:00
return status.reblog && status.reblog.id
}
export async function getIdsThatTheseStatusesReblogged (instanceName, statusIds) {
let reblogIds = await Promise.all(statusIds.map(async statusId => {
return getIdThatThisStatusReblogged(instanceName, statusId)
}))
return reblogIds.filter(Boolean)
2018-02-17 04:38:21 +01:00
}
export async function getIdsThatRebloggedThisStatus (instanceName, statusId) {
return database.getReblogsForStatus(instanceName, statusId)
2018-02-17 04:38:21 +01:00
}
export async function getNotificationIdsForStatuses (instanceName, statusIds) {
return database.getNotificationIdsForStatuses(instanceName, statusIds)
2018-02-17 04:38:21 +01:00
}