Private
Public Access
otro hook que me habia olvidado de repuestos
This commit is contained in:
1 parent
3d52f00e24
commit
6dddfdb9ab
1 file changed
+2
-2
@@ -4,13 +4,13 @@ import { getToken } from '../token';
|
|||||||
|
|
||||||
export async function actualizarRepuesto(repuesto: ActualizarRepuestoDto) {
|
export async function actualizarRepuesto(repuesto: ActualizarRepuestoDto) {
|
||||||
try {
|
try {
|
||||||
const req = await fetch(`${API_URL}/repuestos/${repuesto.id || 0}`, {
|
const req = await fetch(`${API_URL}/repuestos/${repuesto.ID || 0}`, {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
Authorization: `Bearer ${getToken()}`
|
Authorization: `Bearer ${getToken()}`
|
||||||
},
|
},
|
||||||
body: JSON.stringify((({ id, ...rest }) => rest)(repuesto))
|
body: JSON.stringify((({ ID, ...rest }) => rest)(repuesto))
|
||||||
});
|
});
|
||||||
|
|
||||||
if (req.ok) {
|
if (req.ok) {
|
||||||
|
|||||||
Reference in new issue
Block a user