mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-14 16:28:59 +00:00
[Glitch] Add button to load new replies in web UI
Port 14a781fa24 to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
import { apiRequestGet } from 'flavours/glitch/api';
|
||||
import api, { getAsyncRefreshHeader } from 'flavours/glitch/api';
|
||||
import type { ApiContextJSON } from 'flavours/glitch/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),
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user