mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Add mute status in account and channel pages
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
|
||||
|
||||
import { AccountBlock, HttpStatusCode, ResultList, ServerBlock } from '@shared/models'
|
||||
import { AccountBlock, BlockStatus, HttpStatusCode, ResultList, ServerBlock } from '@shared/models'
|
||||
import { AbstractCommand, OverrideCommandOptions } from '../shared'
|
||||
|
||||
type ListBlocklistOptions = OverrideCommandOptions & {
|
||||
@@ -37,6 +37,29 @@ export class BlocklistCommand extends AbstractCommand {
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
getStatus (options: OverrideCommandOptions & {
|
||||
accounts?: string[]
|
||||
hosts?: string[]
|
||||
}) {
|
||||
const { accounts, hosts } = options
|
||||
|
||||
const path = '/api/v1/blocklist/status'
|
||||
|
||||
return this.getRequestBody<BlockStatus>({
|
||||
...options,
|
||||
|
||||
path,
|
||||
query: {
|
||||
accounts,
|
||||
hosts
|
||||
},
|
||||
implicitToken: false,
|
||||
defaultExpectedStatus: HttpStatusCode.OK_200
|
||||
})
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
addToMyBlocklist (options: OverrideCommandOptions & {
|
||||
account?: string
|
||||
server?: string
|
||||
|
||||
15
shared/models/moderation/block-status.model.ts
Normal file
15
shared/models/moderation/block-status.model.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
export interface BlockStatus {
|
||||
accounts: {
|
||||
[ handle: string ]: {
|
||||
blockedByServer: boolean
|
||||
blockedByUser?: boolean
|
||||
}
|
||||
}
|
||||
|
||||
hosts: {
|
||||
[ host: string ]: {
|
||||
blockedByServer: boolean
|
||||
blockedByUser?: boolean
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
export * from './abuse'
|
||||
export * from './block-status.model'
|
||||
export * from './account-block.model'
|
||||
export * from './server-block.model'
|
||||
|
||||
Reference in New Issue
Block a user