feat: get breakfast package from API

This commit is contained in:
Simon Emanuelsson
2024-10-28 10:12:03 +01:00
parent fc8844eb96
commit 62f549e85d
47 changed files with 718 additions and 210 deletions

View File

@@ -75,7 +75,7 @@ function getUniqueRewardIds(rewardIds: string[]) {
const getAllCachedApiRewards = unstable_cache(
async function (token) {
const apiResponse = await api.get(api.endpoints.v1.tierRewards, {
const apiResponse = await api.get(api.endpoints.v1.Profile.tierRewards, {
headers: {
Authorization: `Bearer ${token}`,
},
@@ -194,7 +194,7 @@ export const rewardQueryRouter = router({
const { limit, cursor } = input
const apiResponse = await api.get(api.endpoints.v1.rewards, {
const apiResponse = await api.get(api.endpoints.v1.Profile.reward, {
cache: undefined, // override defaultOptions
headers: {
Authorization: `Bearer ${ctx.session.token.access_token}`,
@@ -393,7 +393,7 @@ export const rewardQueryRouter = router({
surprises: contentStackBaseWithProtectedProcedure.query(async ({ ctx }) => {
getCurrentRewardCounter.add(1)
const apiResponse = await api.get(api.endpoints.v1.rewards, {
const apiResponse = await api.get(api.endpoints.v1.Profile.reward, {
cache: undefined, // override defaultOptions
headers: {
Authorization: `Bearer ${ctx.session.token.access_token}`,