Skip to content

Commit

Permalink
Merge pull request #37 from Rikthepixel/fix/kubernetes-deployment
Browse files Browse the repository at this point in the history
Fix/kubernetes deployment
  • Loading branch information
Rikthepixel authored Jan 10, 2024
2 parents e19546f + c9a09d4 commit bf2548a
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- name: Set env variables
run: |
echo "VITE_BACKEND_URL=sq.api.rikdenbreejen.nl" >> ./apps/frontend/.env
echo "VITE_BACKEND_URL=https://sq.api.rikdenbreejen.nl" >> ./apps/frontend/.env
echo "VITE_AUTH_DOMAIN_URL=https://square-market.eu.auth0.com" >> ./apps/frontend.env
echo "VITE_AUTH_CLIENT_ID=PObklfrWNeQzWTEsWP6mTkRuSCPgZn7r" >> ./apps/frontend/.env
Expand Down
4 changes: 2 additions & 2 deletions apps/frontend/src/apis/ads/categories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { GetCategoriesResponse } from '@/responses/ads/categories/GetCategoriesR

export function getCategories(signal?: AbortSignal) {
return backend
.get(`v1/ads/categories`, { signal })
.get(`v1/posts/categories`, { signal })
.json<GetCategoriesResponse>();
}

export function getCategory(uid: string, signal?: AbortSignal) {
return backend
.get(`v1/ads/categories/${uid}`, { signal })
.get(`v1/posts/categories/${uid}`, { signal })
.json<CategoryResponse>();
}
2 changes: 1 addition & 1 deletion apps/frontend/src/apis/ads/images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ if (typeof backendUrl !== 'string')
throw new Error('VITE_BACKEND_URL ENV variable is required');

export function getImageUrl(uid: string) {
return `${backendUrl}/v1/ads/images/${uid}`
return `${backendUrl}/v1/posts/images/${uid}`
}
4 changes: 2 additions & 2 deletions apps/frontend/src/apis/ads/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function getFilteredAdvertisements(
}

const ads = await backend
.get(`v1/ads/filter?${params.toString()}`, { signal })
.get(`v1/posts/filter?${params.toString()}`, { signal })
.json();

if (!Array.isArray(ads)) throw Error('ResponseParseFailure');
Expand All @@ -40,7 +40,7 @@ export async function getPublicAdvertisement(
signal?: AbortSignal,
) {
return await backend
.get(`v1/ads/${uid}`, { signal })
.get(`v1/posts/${uid}`, { signal })
.json<any>()
.then<PublicAdvertisementResponse>((ad) => ({
...ad,
Expand Down
16 changes: 8 additions & 8 deletions apps/frontend/src/apis/ads/manage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { GetPublishedAdvertisementsResponse } from '@/responses/ads/manage/GetPu

export async function getAdvertisement(uid: string, signal?: AbortSignal) {
return await backend
.get(`v1/ads/manage/${uid}`, { signal })
.get(`v1/posts/manage/${uid}`, { signal })
.then(async (kyResponse) => {
const response = await kyResponse.json<GetAdvertisementResponse>();
response.draft = Boolean(response.draft);
Expand All @@ -18,7 +18,7 @@ export async function getAdvertisement(uid: string, signal?: AbortSignal) {
export async function getPublishedAdvertisements(
signal?: AbortSignal,
): Promise<GetPublishedAdvertisementsResponse> {
const ads = await backend.get('v1/ads/manage/published', { signal }).json();
const ads = await backend.get('v1/posts/manage/published', { signal }).json();
if (!Array.isArray(ads)) throw Error('ResponseParseFailure');
return ads.map((ad) => ({
...ad,
Expand All @@ -28,21 +28,21 @@ export async function getPublishedAdvertisements(

export async function getDraftAdvertisements(signal?: AbortSignal) {
return await backend
.get('v1/ads/manage/drafts', { signal })
.get('v1/posts/manage/drafts', { signal })
.json<GetDraftAdvertisementsResponse>();
}

export async function createAdvertisement() {
return await backend
.post('v1/ads/manage/create')
.post('v1/posts/manage/create')
.json<CreateAdvertisementResponse>();
}

export async function putAdvertisement(
uid: string,
request: PutAdvertisementRequest,
) {
return await backend.put(`v1/ads/manage/${uid}`, {
return await backend.put(`v1/posts/manage/${uid}`, {
json: request,
});
}
Expand All @@ -54,16 +54,16 @@ export async function uploadAdvertisementImage(uid: string, images: File[]) {
}

return await backend
.post(`v1/ads/manage/${uid}/images`, {
.post(`v1/posts/manage/${uid}/images`, {
body: request,
})
.json<string[]>();
}

export async function unpublishAdvertisement(uid: string) {
return await backend.delete(`v1/ads/manage/${uid}/unpublish`);
return await backend.delete(`v1/posts/manage/${uid}/unpublish`);
}

export async function deleteAdvertisement(uid: string) {
return await backend.delete(`v1/ads/manage/${uid}`);
return await backend.delete(`v1/posts/manage/${uid}`);
}
4 changes: 2 additions & 2 deletions apps/gateway/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ gateway({
target: SERVICES.accounts,
},
{
prefix: '/v1/ads/manage',
prefix: '/v1/posts/manage',
prefixRewrite: '/v1/manage',
target: SERVICES.ads,
},
],
AUTH_CONFIG,
),
{
prefix: '/v1/ads',
prefix: '/v1/posts',
prefixRewrite: '/v1',
target: SERVICES.ads,
},
Expand Down

0 comments on commit bf2548a

Please sign in to comment.