Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 2x 3x 3x 4x | /**
* Watch Pairing API Client
* Story W2.1: Pairing Code Backend & Web Frontend
*/
import apiClient from '@/services/api/apiClient';
import type { PairingCodeResponse, PairingStatusResponse } from '@/types/watch';
const watchPairingApi = {
generatePairingCode: (username: string): Promise<PairingCodeResponse> =>
apiClient.post<PairingCodeResponse>(`/users/${username}/watch-pairing`).then((r) => r.data),
getPairingStatus: (username: string): Promise<PairingStatusResponse> =>
apiClient.get<PairingStatusResponse>(`/users/${username}/watch-pairing`).then((r) => r.data),
unpairWatch: (username: string, watchId: string): Promise<void> =>
apiClient.delete(`/users/${username}/watch-pairing/${watchId}`).then(() => undefined),
};
export default watchPairingApi;
|