MCPcopy Index your code
hub / github.com/sqlchat/sqlchat / refreshQuota

Function refreshQuota

src/components/QuotaView.tsx:23–34  ·  view source on GitHub ↗
(userId: string)

Source from the content-addressed store, hash-verified

21 const showActionButton = !session || session.user.subscription.plan === "FREE" || expired;
22
23 const refreshQuota = async (userId: string) => {
24 let quota: Quota = { current: 0, limit: 0 };
25 try {
26 const { data } = await axios.get("/api/usage", {
27 headers: { Authorization: `Bearer ${userId}` },
28 });
29 quota = data;
30 } catch (error) {
31 // do nth
32 }
33 setQuota(quota);
34 };
35
36 getEventEmitter().on("usage.update", () => {
37 if (session?.user.id) {

Callers 1

QuotaViewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected