京都のkintone用javascript
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

40 líneas
1022B

  1. import { AppID } from "@/common/appids";
  2. import {
  3. ParkingNavi駐車場プラン,
  4. ParkingNavi駐車場プランフィールド名,
  5. } from "@/types/ParkingNavi駐車場プラン";
  6. import { KintoneRestAPIClient } from "@kintone/rest-api-client";
  7. import { sprintf } from "sprintf";
  8. const client = new KintoneRestAPIClient();
  9. export const getParkingNavi駐車場プラン = async (
  10. プラン名: string
  11. ): Promise<ParkingNavi駐車場プラン> => {
  12. const query = sprintf(
  13. sprintf(
  14. '%s = "%s"',
  15. ParkingNavi駐車場プランフィールド名.定期駐車場プラン,
  16. プラン名
  17. )
  18. );
  19. const { records } = await client.record.getRecords<ParkingNavi駐車場プラン>({
  20. app: AppID.ParkingNavi駐車場プラン,
  21. query,
  22. });
  23. if (records.length !== 1) {
  24. throw new Error(
  25. sprintf(
  26. "ParkingNavi駐車場プラン取得数数エラー expect %d, actual %d query:%s",
  27. 1,
  28. records.length,
  29. query
  30. )
  31. );
  32. }
  33. return records[0];
  34. };