mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-28 22:49:24 +09:00
perf(backend): allow get for some endpoints (#92)
Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
parent
b4f720cab6
commit
65a75ecd9a
@ -9,6 +9,8 @@ export const meta = {
|
|||||||
tags: ['meta'],
|
tags: ['meta'],
|
||||||
|
|
||||||
requireCredential: false,
|
requireCredential: false,
|
||||||
|
allowGet: true,
|
||||||
|
cacheSec: 60 * 1,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export const paramDef = {
|
export const paramDef = {
|
||||||
|
@ -26,6 +26,8 @@ export const meta = {
|
|||||||
tags: ['hashtags'],
|
tags: ['hashtags'],
|
||||||
|
|
||||||
requireCredential: false,
|
requireCredential: false,
|
||||||
|
allowGet: true,
|
||||||
|
cacheSec: 60 * 1,
|
||||||
|
|
||||||
res: {
|
res: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
|
@ -73,7 +73,7 @@ let fetching = $ref(true);
|
|||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
const [_stats, _onlineUsersCount] = await Promise.all([
|
const [_stats, _onlineUsersCount] = await Promise.all([
|
||||||
os.api('stats', {}),
|
os.api('stats', {}),
|
||||||
os.api('get-online-users-count').then(res => res.count),
|
os.apiGet('get-online-users-count').then(res => res.count),
|
||||||
]);
|
]);
|
||||||
stats = _stats;
|
stats = _stats;
|
||||||
onlineUsersCount = _onlineUsersCount;
|
onlineUsersCount = _onlineUsersCount;
|
||||||
|
@ -40,7 +40,7 @@ const { widgetProps, configure } = useWidgetPropsManager(name,
|
|||||||
const onlineUsersCount = ref(0);
|
const onlineUsersCount = ref(0);
|
||||||
|
|
||||||
const tick = () => {
|
const tick = () => {
|
||||||
os.api('get-online-users-count').then(res => {
|
os.apiGet('get-online-users-count').then(res => {
|
||||||
onlineUsersCount.value = res.count;
|
onlineUsersCount.value = res.count;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -53,7 +53,7 @@ const stats = ref([]);
|
|||||||
const fetching = ref(true);
|
const fetching = ref(true);
|
||||||
|
|
||||||
const fetch = () => {
|
const fetch = () => {
|
||||||
os.api('hashtags/trend').then(res => {
|
os.apiGet('hashtags/trend').then(res => {
|
||||||
stats.value = res;
|
stats.value = res;
|
||||||
fetching.value = false;
|
fetching.value = false;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user