|
|
|
|
@ -3,7 +3,7 @@ |
|
|
|
|
* バックエンドAPIとの通信を担当するモジュール |
|
|
|
|
* 認証、タスク管理などの機能を提供 |
|
|
|
|
*/ |
|
|
|
|
import { LoginCredentials, RegisterCredentials, AuthResponse, Task, ToBuy } from '../types/types'; |
|
|
|
|
import { LoginCredentials, RegisterCredentials, AuthResponse, Task, ToBuy, Stuff } from '../types/types'; |
|
|
|
|
import { AUTH_ERRORS, TASK_ERRORS } from '../constants/errorMessages'; |
|
|
|
|
|
|
|
|
|
// APIのベースURL - 環境変数から取得するか、デフォルト値を使用
|
|
|
|
|
@ -171,6 +171,25 @@ export const toBuyApi = { |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const stuffApi = { |
|
|
|
|
getStuffs: async (category: string): Promise<{ stuff_array: Stuff[] }> => { |
|
|
|
|
return { |
|
|
|
|
"stuff_array": [ |
|
|
|
|
{ |
|
|
|
|
"stuff_id": 6, |
|
|
|
|
"stuff_name": "鯖", |
|
|
|
|
"category": "魚" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"stuff_id": 10, |
|
|
|
|
"stuff_name": "鯛", |
|
|
|
|
"category": "魚", |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* (サンプル,実際には不要) |
|
|
|
|
|