Add button to load new replies in web UI (#35210)
This commit is contained in:
parent
cec26d58c8
commit
14a781fa24
18 changed files with 411 additions and 26 deletions
5
app/javascript/mastodon/api/async_refreshes.ts
Normal file
5
app/javascript/mastodon/api/async_refreshes.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import { apiRequestGet } from 'mastodon/api';
|
||||
import type { ApiAsyncRefreshJSON } from 'mastodon/api_types/async_refreshes';
|
||||
|
||||
export const apiGetAsyncRefresh = (id: string) =>
|
||||
apiRequestGet<ApiAsyncRefreshJSON>(`v1_alpha/async_refreshes/${id}`);
|
||||
|
|
@ -1,5 +1,14 @@
|
|||
import { apiRequestGet } from 'mastodon/api';
|
||||
import api, { getAsyncRefreshHeader } from 'mastodon/api';
|
||||
import type { ApiContextJSON } from 'mastodon/api_types/statuses';
|
||||
|
||||
export const apiGetContext = (statusId: string) =>
|
||||
apiRequestGet<ApiContextJSON>(`v1/statuses/${statusId}/context`);
|
||||
export const apiGetContext = async (statusId: string) => {
|
||||
const response = await api().request<ApiContextJSON>({
|
||||
method: 'GET',
|
||||
url: `/api/v1/statuses/${statusId}/context`,
|
||||
});
|
||||
|
||||
return {
|
||||
context: response.data,
|
||||
refresh: getAsyncRefreshHeader(response),
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue