Skip to content

Commit

Permalink
function api
Browse files Browse the repository at this point in the history
  • Loading branch information
tamaina committed Jan 15, 2023
1 parent 567f937 commit c5b5040
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/frontend/src/scripts/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { $i } from '@/account';
export const pendingApiRequestsCount = ref(0);

// Implements Misskey.api.ApiClient.request
export const api = <E extends keyof Endpoints, P extends Endpoints[E]['req']>(endpoint: E, data: P = {} as any, token?: string | null | undefined): Promise<Endpoints[E]['res']> => {
export function api<E extends keyof Endpoints, P extends Endpoints[E]['req']>(endpoint: E, data: P = {} as any, token?: string | null | undefined): Promise<Endpoints[E]['res']> {
pendingApiRequestsCount.value++;

const onFinally = () => {
Expand Down Expand Up @@ -45,7 +45,7 @@ export const api = <E extends keyof Endpoints, P extends Endpoints[E]['req']>(en
}

// Implements Misskey.api.ApiClient.request
export const apiGet = <E extends keyof Endpoints, P extends Endpoints[E]['req']>(endpoint: E, data: P = {} as any): Promise<Endpoints[E]['res']> => {
export function apiGet <E extends keyof Endpoints, P extends Endpoints[E]['req']>(endpoint: E, data: P = {} as any): Promise<Endpoints[E]['res']> {
pendingApiRequestsCount.value++;

const onFinally = () => {
Expand Down

0 comments on commit c5b5040

Please sign in to comment.