Skip to content

feat: update mirage tests and route handlers for owner invites #5397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

LeoBorai
Copy link
Contributor

Uses api/private over api/v1/me for mirage pending owner invites endpoint.
And also adds the expires_at attribute as part of the payload received as
found in the EncodableCrateOwnerInvitationV1 struct from the API.

Uses `api/private` over `api/v1/me` for mirage pending owner invites
endpoint. And also adds the `expires_at` attribute as part of the
payload received as found in the `EncodableCrateOwnerInvitationV1`
struct from the API.
return new Response(403, {}, { errors: [{ detail: 'must be logged in to perform that action' }] });
}

return schema.crateOwnerInvitations.where({ inviteeId: user.id });
Copy link
Member

Choose a reason for hiding this comment

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

the new endpoint actually works a little bit different. it supports (and iirc requires) query parameters to determine which invites to show.

@LeoBorai LeoBorai force-pushed the feat/update-crate-owner-invitations-mirage branch from 9fde45f to b3034ac Compare November 3, 2022 02:19
@Turbo87 Turbo87 added A-frontend 🐹 C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear labels Nov 10, 2022
@Turbo87
Copy link
Member

Turbo87 commented Nov 20, 2022

I just realized that there is already an implementation for that route handler and I just forgot about it... 🤦‍♂️

see https://github.com/rust-lang/crates.io/blob/59e4fd4ab2be9f37c40f7beb536415dda81d2125/mirage/route-handlers/invites.js 😅

sorry for the back and forth. I think with this out of the way the next step would be to switch the existing Ember Data code over to using the new endpoint instead.

since this PR was AFAIU only about adding the mirage endpoint I'll go ahead and close it until we have a PR that updates the Ember Data code :)

@Turbo87 Turbo87 closed this Nov 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend 🐹 C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants