mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-25 20:06:30 +00:00
Refactor <DomainBlocks> to TypeScript (#34347)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
13
app/javascript/mastodon/api/domain_blocks.ts
Normal file
13
app/javascript/mastodon/api/domain_blocks.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import api, { getLinks } from 'mastodon/api';
|
||||
|
||||
export const apiGetDomainBlocks = async (url?: string) => {
|
||||
const response = await api().request<string[]>({
|
||||
method: 'GET',
|
||||
url: url ?? '/api/v1/domain_blocks',
|
||||
});
|
||||
|
||||
return {
|
||||
domains: response.data,
|
||||
links: getLinks(response),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user