mirror of
https://git.victorphan.net/basketballcantho/zalo-monitor.git
synced 2026-08-05 06:13:10 +07:00
18 lines
546 B
TypeScript
18 lines
546 B
TypeScript
import { apiFactory } from "../utils.js";
|
|
|
|
import type { User } from "../models/index.js";
|
|
|
|
export type FetchAccountInfoResponse = { profile: User };
|
|
|
|
export const fetchAccountInfoFactory = apiFactory<FetchAccountInfoResponse>()((api, _, utils) => {
|
|
const serviceURL = utils.makeURL(`${api.zpwServiceMap.profile[0]}/api/social/profile/me-v2`);
|
|
|
|
return async function fetchAccountInfo() {
|
|
const response = await utils.request(serviceURL, {
|
|
method: "GET",
|
|
});
|
|
|
|
return utils.resolve(response);
|
|
};
|
|
});
|