TypeScriptã®ããã¸ã§ã¯ãã§APIãã³ã¼ã«ããéã«ä½¿ç¨ããfetchã®å¦çãã¨ã©ã¼ãã³ããªã³ã°ãªã©ãå«ãã¦å ±éå¦çã¨ãã¦å®è£ ãã¾ãã åã®å®ç¾©ã¾ãã¯APIããã®ã¬ã¹ãã³ã¹ã®å ±éã®åãå®ç¾©ãã¾ãã ãæ£å¸¸æã¾ãã¯ç°å¸¸æãã®åãå®ç¾©ãã¾ãã æ£å¸¸æã¯APIã«ãã£ã¦åã¯å¤ãããããã¸ã§ããªãã¯ã§æå®ã§ããããã«ãã¦ãç°å¸¸æã¯ã·ã¹ãã å ±éã®åã§ã¬ã¹ãã³ã¹ããããã¨ãæ³å®ãã¦ãã¾ãã æ£å¸¸æã¾ãã¯ç°å¸¸æã«ããããã®åã§dataã«ã¢ã¯ã»ã¹ããããã«okãã£ã¼ã«ããbooleanã§ã¯ãªãtrueã¾ãã¯falseåºå®ã§å®ç¾©ãã¾ãã // APIã®ã¬ã¹ãã³ã¹ã®å export type ApiResult<T> = ApiSuccessResult<T> | ApiErrorResult; // æ£å¸¸æã®å export type ApiSuccessResult<T> = { data: T; o
{{#tags}}- {{label}}
{{/tags}}