mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-15 08:48:53 +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:
5
app/javascript/flavours/glitch/api/async_refreshes.ts
Normal file
5
app/javascript/flavours/glitch/api/async_refreshes.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { apiRequestGet } from 'flavours/glitch/api';
|
||||
import type { ApiAsyncRefreshJSON } from 'flavours/glitch/api_types/async_refreshes';
|
||||
|
||||
export const apiGetAsyncRefresh = (id: string) =>
|
||||
apiRequestGet<ApiAsyncRefreshJSON>(`v1_alpha/async_refreshes/${id}`);
|
||||
@@ -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