fix: update baseURL configuration and remove unnecessary response logging in media service
Build and Release / release (push) Successful in 29s
Build and Release / release (push) Successful in 29s
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import axios, { AxiosError, InternalAxiosRequestConfig } from "axios";
|
import axios, { AxiosError, InternalAxiosRequestConfig } from "axios";
|
||||||
|
|
||||||
export const baseURL = process.env.NEXT_PUBLIC_API_URL || "http://localhost:3344";
|
export const baseURL =
|
||||||
|
process.env.NEXT_PUBLIC_API_URL_ROOT || process.env.NEXT_PUBLIC_API_URL || "http://localhost:3344";
|
||||||
|
|
||||||
export const api = axios.create({
|
export const api = axios.create({
|
||||||
baseURL,
|
baseURL,
|
||||||
|
|||||||
@@ -52,20 +52,18 @@ export const uploadFileToS3 = async (
|
|||||||
file: File,
|
file: File,
|
||||||
presigned: PreSignedResponse,
|
presigned: PreSignedResponse,
|
||||||
) => {
|
) => {
|
||||||
const res = await axios.put(presigned.upload_url, file, {
|
await axios.put(presigned.upload_url, file, {
|
||||||
headers: {
|
headers: {
|
||||||
...presigned.signed_headers,
|
...presigned.signed_headers,
|
||||||
"Content-Type": file.type,
|
"Content-Type": file.type,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
// console.log("Response from S3 upload:", res);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const confirmUpload = async (token_id: string) => {
|
export const confirmUpload = async (token_id: string) => {
|
||||||
const res = await api.post("/media/presigned/complete", {
|
const res = await api.post("/media/presigned/complete", {
|
||||||
token_id,
|
token_id,
|
||||||
});
|
});
|
||||||
// console.log("Response from confirm upload:", res);
|
|
||||||
return res.data;
|
return res.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user