apply license
This commit is contained in:
13
src/composables/useKintoneClient.ts
Normal file
13
src/composables/useKintoneClient.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user