u
This commit is contained in:
137
src/api/index.js
137
src/api/index.js
@@ -432,6 +432,53 @@ export const article = {
|
||||
body,
|
||||
});
|
||||
},
|
||||
/**
|
||||
* GET /api/article/:sku/attributevalue → { attributevalues: ArticleAttributeValue[] }
|
||||
*/
|
||||
getAttributeValues(sku) {
|
||||
return http(`/api/article/${encodeURIComponent(sku)}/attributevalue`);
|
||||
},
|
||||
|
||||
/**
|
||||
* PUT /api/article/:sku/attributevalue
|
||||
* Body: { attributevalues: number[] | { attributeValueId: number, sort?: number }[] }
|
||||
* → 200 { attributevalues: ArticleAttributeValue[] }
|
||||
*/
|
||||
setAttributeValues(sku, attributevalues) {
|
||||
return http(`/api/article/${encodeURIComponent(sku)}/attributevalue`, {
|
||||
method: 'PUT',
|
||||
body: { attributevalues },
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* GET /api/article/:sku/property → { properties: ArticleProperty[] }
|
||||
*/
|
||||
getProperties(sku) {
|
||||
return http(`/api/article/${encodeURIComponent(sku)}/property`);
|
||||
},
|
||||
|
||||
/**
|
||||
* PUT /api/article/:sku/property
|
||||
* Body: { properties: { propertyId: number, value: string, sort?: number }[] }
|
||||
* → 200 { properties: ArticleProperty[] }
|
||||
*/
|
||||
setProperties(sku, properties) {
|
||||
return http(`/api/article/${encodeURIComponent(sku)}/property`, {
|
||||
method: 'PUT',
|
||||
body: { properties },
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* DELETE /api/article/:sku/property/:propertyId → 200 { ok: true }
|
||||
*/
|
||||
deleteProperty(sku, propertyId) {
|
||||
return http(
|
||||
`/api/article/${encodeURIComponent(sku)}/property/${encodeURIComponent(propertyId)}`,
|
||||
{ method: 'DELETE' }
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -679,6 +726,93 @@ export const brand = {
|
||||
},
|
||||
};
|
||||
|
||||
export const attributename = {
|
||||
/** GET /api/attributename → { attributenames: Attributename[] } */
|
||||
list() {
|
||||
return http('/api/attributename');
|
||||
},
|
||||
|
||||
/** POST /api/attributename → 201 { attributename } */
|
||||
create(body) {
|
||||
return http('/api/attributename', { method: 'POST', body });
|
||||
},
|
||||
|
||||
/** PATCH /api/attributename/:id → 200 { attributename } */
|
||||
update(id, body) {
|
||||
return http(`/api/attributename/${encodeURIComponent(id)}`, { method: 'PATCH', body });
|
||||
},
|
||||
|
||||
/** DELETE /api/attributename/:id → 200 */
|
||||
delete(id) {
|
||||
return http(`/api/attributename/${encodeURIComponent(id)}`, { method: 'DELETE' });
|
||||
},
|
||||
|
||||
/** PUT /api/attributename/order → 200 */
|
||||
order(attributenameIds) {
|
||||
return http('/api/attributename/order', { method: 'PUT', body: { attributenameIds } });
|
||||
},
|
||||
};
|
||||
|
||||
export const attributevalue = {
|
||||
/** GET /api/attributename/:attributeId/value → { values: AttributeValue[] } */
|
||||
listByAttributeId(attributeId) {
|
||||
return http(`/api/attributename/${encodeURIComponent(attributeId)}/value`);
|
||||
},
|
||||
|
||||
/** POST /api/attributename/:attributeId/value → 201 { attributevalue } */
|
||||
create(attributeId, body) {
|
||||
return http(`/api/attributename/${encodeURIComponent(attributeId)}/value`, {
|
||||
method: 'POST',
|
||||
body,
|
||||
});
|
||||
},
|
||||
|
||||
/** PATCH /api/attributevalue/:id → 200 { attributevalue } */
|
||||
update(id, body) {
|
||||
return http(`/api/attributevalue/${encodeURIComponent(id)}`, { method: 'PATCH', body });
|
||||
},
|
||||
|
||||
/** DELETE /api/attributevalue/:id → 200 */
|
||||
delete(id) {
|
||||
return http(`/api/attributevalue/${encodeURIComponent(id)}`, { method: 'DELETE' });
|
||||
},
|
||||
|
||||
/** PUT /api/attributename/:attributeId/value/order → 200 */
|
||||
order(attributeId, attributevalueIds) {
|
||||
return http(`/api/attributename/${encodeURIComponent(attributeId)}/value/order`, {
|
||||
method: 'PUT',
|
||||
body: { attributevalueIds },
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export const propertyname = {
|
||||
/** GET /api/propertyname → { propertynames: Propertyname[] } */
|
||||
list() {
|
||||
return http('/api/propertyname');
|
||||
},
|
||||
|
||||
/** POST /api/propertyname → 201 { propertyname } */
|
||||
create(body) {
|
||||
return http('/api/propertyname', { method: 'POST', body });
|
||||
},
|
||||
|
||||
/** PATCH /api/propertyname/:id → 200 { propertyname } */
|
||||
update(id, body) {
|
||||
return http(`/api/propertyname/${encodeURIComponent(id)}`, { method: 'PATCH', body });
|
||||
},
|
||||
|
||||
/** DELETE /api/propertyname/:id → 200 */
|
||||
delete(id) {
|
||||
return http(`/api/propertyname/${encodeURIComponent(id)}`, { method: 'DELETE' });
|
||||
},
|
||||
|
||||
/** PUT /api/propertyname/order → 200 */
|
||||
order(propertynameIds) {
|
||||
return http('/api/propertyname/order', { method: 'PUT', body: { propertynameIds } });
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Company-scoped suppliers / Lieferanten (selectedCompanyId from session).
|
||||
* Shape: Supplier = { id, name, createdAt, updatedAt }
|
||||
@@ -1587,6 +1721,8 @@ export default {
|
||||
auth,
|
||||
article,
|
||||
articleIndex,
|
||||
attributename,
|
||||
attributevalue,
|
||||
brand,
|
||||
category,
|
||||
company,
|
||||
@@ -1599,6 +1735,7 @@ export default {
|
||||
order,
|
||||
posterminal,
|
||||
printer,
|
||||
propertyname,
|
||||
quote,
|
||||
supplier,
|
||||
thumb,
|
||||
|
||||
Reference in New Issue
Block a user