[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:
Eugen Rochko
2025-07-23 15:42:07 +02:00
committed by Claire
parent d9c1e45739
commit a8432560ba
8 changed files with 204 additions and 13 deletions

View File

@@ -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),
};
};