feat: self-serve signup Phase 2 (frontend cutover) (#162)
Co-authored-by: Michael Chihlas <michael@resolutionflow.com> Co-committed-by: Michael Chihlas <michael@resolutionflow.com>
This commit was merged in pull request #162.
This commit is contained in:
23
frontend/src/api/usage.ts
Normal file
23
frontend/src/api/usage.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import apiClient from './client'
|
||||
|
||||
/**
|
||||
* Usage counters API.
|
||||
*
|
||||
* TODO: backend `/usage/{field}` endpoint not yet implemented (planned).
|
||||
* Tracked under self-serve signup Phase 2 — Task 33 calls this lazily; today
|
||||
* it 404s and the consuming hook (`useFeatureLimit`) cleanly degrades to
|
||||
* `used = 0`.
|
||||
*/
|
||||
export const usageApi = {
|
||||
/**
|
||||
* Fetch the current count for a usage field (e.g. `active_users`,
|
||||
* `flowpilot_sessions_this_month`). The field name is the same key used in
|
||||
* `BillingState.planLimits`.
|
||||
*/
|
||||
async getCount(field: string): Promise<{ used: number }> {
|
||||
const response = await apiClient.get<{ used: number }>(`/usage/${field}`)
|
||||
return response.data
|
||||
},
|
||||
}
|
||||
|
||||
export default usageApi
|
||||
Reference in New Issue
Block a user