-
Notifications
You must be signed in to change notification settings - Fork 744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Task 7 #509
base: main
Are you sure you want to change the base?
Task 7 #509
Conversation
@@ -31,6 +31,9 @@ export default function CSVFileImport({ url, title }: CSVFileImportProps) { | |||
} | |||
const response = await axios({ | |||
method: "GET", | |||
headers: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest using axios.interceptors to prevent nessesety to add authorization for every request manually
@@ -48,7 +48,7 @@ export function useRemoveProductCache() { | |||
|
|||
export function useUpsertAvailableProduct() { | |||
return useMutation((values: AvailableProduct) => | |||
axios.put<AvailableProduct>(`${API_PATHS.bff}/product`, values, { | |||
axios.post<AvailableProduct>(`${API_PATHS.bff}/products`, values, { | |||
headers: { | |||
Authorization: `Basic ${localStorage.getItem("authorization_token")}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same as above for authorization's header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Headers is not my code, I have no reason to change it in scope of my task
It looks to weird you made a PR into the common repo, not your local fork. |
6d82883
to
9e5a538
Compare
You should add key:value to local storage
key: authorization_token
value: Basic c2VuZWthX2VwYW0xMzpURVNUX1BBU1NXT1JE