Skip to content

API Wrapper Module#58

Open
JManion32 wants to merge 4 commits intomainfrom
feature/caps-52-api-wrapper-module
Open

API Wrapper Module#58
JManion32 wants to merge 4 commits intomainfrom
feature/caps-52-api-wrapper-module

Conversation

@JManion32
Copy link
Copy Markdown
Contributor

@JManion32 JManion32 commented Mar 25, 2026

This PR adds a reusable wrapper module for API usage.

  • client.ts is the sole file that makes a request
  • The other files (users.ts, auth.ts, events.ts, organizations.ts) are split just like the API is split.
  • Added types to support expected API requests and responses
  • Adjusted current "sample" data to reflect current types
  • Adjusted AuthContext.tsx to use the new wrapper module (still working on making it perfect)

We need to give the API a look. There are some missing fields in responses that probably should be there. Additionally, some of the responses aren't consistent, so I had to make a lot of types. I could probably look into making some of the type fields optional to remedy this.

Using the Wrapper

Ideally it will be used in hooks. I didn't abstract the AuthContext because its a little messy (which is probably fine since its a context).

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @JManion32! 👋

Your private repo does not have access to Sourcery.

Please upgrade to continue using Sourcery ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant