From 4a6752a3ea848ac094263a9825ed176e802d22ee Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Sun, 20 Nov 2022 17:22:26 +0100 Subject: [PATCH] me/pending-invites: Use `GET /api/private/crate_owner_invitations` endpoint --- app/adapters/crate-owner-invite.js | 4 ++++ app/routes/me/pending-invites.js | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/adapters/crate-owner-invite.js b/app/adapters/crate-owner-invite.js index 2cf69448341..466d0c80b46 100644 --- a/app/adapters/crate-owner-invite.js +++ b/app/adapters/crate-owner-invite.js @@ -6,4 +6,8 @@ export default class CrateOwnerInviteAdapter extends ApplicationAdapter { pathForType() { return 'crate_owner_invitations'; } + + urlForQuery() { + return '/api/private/crate_owner_invitations'; + } } diff --git a/app/routes/me/pending-invites.js b/app/routes/me/pending-invites.js index af51d27432c..9dc7e8d2604 100644 --- a/app/routes/me/pending-invites.js +++ b/app/routes/me/pending-invites.js @@ -3,9 +3,11 @@ import { inject as service } from '@ember/service'; import AuthenticatedRoute from '../-authenticated-route'; export default class PendingInvitesRoute extends AuthenticatedRoute { + @service session; @service store; model() { - return this.store.findAll('crate-owner-invite'); + let user = this.session.currentUser; + return this.store.query('crate-owner-invite', { invitee_id: user.id }); } }