/api/backupProduct
This commit is contained in:
parent
059af5b0dd
commit
be6240d0d5
|
|
@ -18,7 +18,7 @@ export default class Product extends BaseModel {
|
|||
public line: string
|
||||
|
||||
@column()
|
||||
public fileName: string
|
||||
public file: string
|
||||
|
||||
@column()
|
||||
public warehouse: string
|
||||
|
|
|
|||
|
|
@ -384,7 +384,15 @@ Route.post("/api/backupProduct", async ({ request, response }) => {
|
|||
);
|
||||
|
||||
res.data.map((obj, index)=>{
|
||||
res.data[index].line = res.data[index].line.join(",")
|
||||
res.data[index] = {
|
||||
PID:res.data[index].PID,
|
||||
SN:res.data[index].SN,
|
||||
VID:res.data[index].VID,
|
||||
line:res.data[index].line.join(","),
|
||||
file:res.data[index].fileName,
|
||||
warehouse:res.data[index].warehouse,
|
||||
created_at: Date.now()
|
||||
}
|
||||
})
|
||||
|
||||
const addProduct = await Product.createMany(res.data)
|
||||
|
|
|
|||
Loading…
Reference in New Issue