-
Notifications
You must be signed in to change notification settings - Fork 217
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
js-20221021_maxim-b #84
base: master
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import SortableList from '../../2-sortable-list/solution'; | ||
import escapeHtml from './utils/escape-html.js'; | ||
import fetchJson from './utils/fetch-json.js'; | ||
import SortableList from '../../components/sortable-list'; | ||
import escapeHtml from '../../utils/escape-html'; | ||
import fetchJson from '../../utils/fetch-json'; | ||
|
||
const IMGUR_CLIENT_ID = '28aaa2e823b03b1'; | ||
const BACKEND_URL = 'https://course-js.javascript.ru'; | ||
const IMGUR_CLIENT_ID = process.env.IMGUR_CLIENT_ID; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good 👍 |
||
const BACKEND_URL = process.env.BACKEND_URL; | ||
|
||
export default class ProductForm { | ||
element; | ||
|
@@ -213,7 +213,7 @@ export default class ProductForm { | |
async save() { | ||
const product = this.getFormData(); | ||
|
||
const result = await fetchJson(`${BACKEND_URL}/api/rest/products`, { | ||
const result = await fetchJson(`${BACKEND_URL}api/rest/products`, { | ||
method: this.productId ? 'PATCH' : 'PUT', | ||
headers: { | ||
'Content-Type': 'application/json' | ||
|
@@ -276,11 +276,11 @@ export default class ProductForm { | |
} | ||
|
||
loadProductData(productId) { | ||
return fetchJson(`${BACKEND_URL}/api/rest/products?id=${productId}`); | ||
return fetchJson(`${BACKEND_URL}api/rest/products?id=${productId}`); | ||
} | ||
|
||
loadCategoriesList() { | ||
return fetchJson(`${BACKEND_URL}/api/rest/categories?_sort=weight&_refs=subcategory`); | ||
return fetchJson(`${BACKEND_URL}api/rest/categories?_sort=weight&_refs=subcategory`); | ||
} | ||
|
||
createCategoriesSelect() { | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
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.
good 👍,