14 lines
462 B
TypeScript
14 lines
462 B
TypeScript
import { inject } from 'vue';
|
|
import { KintoneClientInjectionKey } from '../plugins/kintoneClient';
|
|
import type { KintoneRestAPIClient } from '@kintone/rest-api-client';
|
|
|
|
export function useKintoneClient(): KintoneRestAPIClient {
|
|
const client = inject<KintoneRestAPIClient>(KintoneClientInjectionKey);
|
|
|
|
if (!client) {
|
|
throw new Error('Kintone client is not provided. Make sure to install the kintoneClient plugin.');
|
|
}
|
|
|
|
return client;
|
|
}
|