Skip to content
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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

seneka-epam13
Copy link

You should add key:value to local storage
key: authorization_token
value: Basic c2VuZWthX2VwYW0xMzpURVNUX1BBU1NXT1JE

@@ -31,6 +31,9 @@ export default function CSVFileImport({ url, title }: CSVFileImportProps) {
}
const response = await axios({
method: "GET",
headers: {

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")}`,

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

Copy link
Author

@seneka-epam13 seneka-epam13 Apr 25, 2024

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

@anddrews
Copy link

It looks to weird you made a PR into the common repo, not your local fork.

@seneka-epam13 seneka-epam13 force-pushed the task-7 branch 2 times, most recently from 6d82883 to 9e5a538 Compare April 25, 2024 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants