use element update route

This commit is contained in:
Yisroel Baum 2026-06-02 16:11:21 +03:00
parent 71bb131687
commit 299ccc4f58
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9

View file

@ -112,7 +112,7 @@ export const useElementsStore = defineStore('elements', () => {
const encodedElementId = encodeURIComponent(elementId) const encodedElementId = encodeURIComponent(elementId)
const elementUrl = `${API_BASE_URL}/api/elements/${encodedElementId}` const elementUrl = `${API_BASE_URL}/api/elements/${encodedElementId}`
const response = await fetch(elementUrl, { const response = await fetch(elementUrl, {
method: 'PATCH', method: 'POST',
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
credentials: 'include', credentials: 'include',
body: JSON.stringify(input), body: JSON.stringify(input),
@ -136,7 +136,7 @@ export const useElementsStore = defineStore('elements', () => {
const elementUrl = `${API_BASE_URL}/api/elements/${encodedElementId}` const elementUrl = `${API_BASE_URL}/api/elements/${encodedElementId}`
const formData = new FormData() const formData = new FormData()
formData.append('iconImage', file) formData.append('iconImage', file)
const response = await fetch(`${elementUrl}/icon-image`, { const response = await fetch(elementUrl, {
method: 'POST', method: 'POST',
headers: { Accept: 'application/json' }, headers: { Accept: 'application/json' },
credentials: 'include', credentials: 'include',
@ -161,7 +161,7 @@ export const useElementsStore = defineStore('elements', () => {
const elementUrl = `${API_BASE_URL}/api/elements/${encodedElementId}` const elementUrl = `${API_BASE_URL}/api/elements/${encodedElementId}`
const formData = new FormData() const formData = new FormData()
formData.append('pdf', file) formData.append('pdf', file)
const response = await fetch(`${elementUrl}/pdf`, { const response = await fetch(elementUrl, {
method: 'POST', method: 'POST',
headers: { Accept: 'application/json' }, headers: { Accept: 'application/json' },
credentials: 'include', credentials: 'include',