Skip to content

Commit

Permalink
update post w proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
s-alad committed Apr 4, 2024
1 parent ee5c26a commit 0b9ea55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion client/pages/api/add/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import moment from 'moment';
// @ts-ignore
import * as convert from 'heic-convert';
import { getAuthHeaders } from '@/utils/authHeaders';
import { PROXY } from '@/utils/constants';

export const config = {
api: {
Expand Down Expand Up @@ -135,7 +136,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
// upload url

let upload_options = {
url: "https://mobile.bereal.com/api/content/posts/upload-url?mimeType=image/webp",
url: `${PROXY}https://mobile.bereal.com/api/content/posts/upload-url?mimeType=image/webp`,
method: "GET",
headers: getAuthHeaders(authorization_token),
}
Expand Down
3 changes: 2 additions & 1 deletion client/pages/api/delete.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { NextApiRequest, NextApiResponse } from 'next'
import axios from 'axios';
import { getAuthHeaders } from '@/utils/authHeaders';
import { PROXY } from '@/utils/constants';

export default async function handler(req: NextApiRequest, res: NextApiResponse) {

Expand All @@ -9,7 +10,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
console.log(authorization_token);

return axios.request({
url: "https://mobile.bereal.com/api" + "/content/posts",
url: `${PROXY}https://mobile.bereal.com/api" + "/content/posts`,
method: "DELETE",
headers: getAuthHeaders(req.body.token),
}).then(
Expand Down

0 comments on commit 0b9ea55

Please sign in to comment.