fix(webui): add items #863
@ -16,8 +16,8 @@ import { webuiRouter } from "@/src/routes/webui";
 | 
				
			|||||||
const app = express();
 | 
					const app = express();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
app.use(bodyParser.raw());
 | 
					app.use(bodyParser.raw());
 | 
				
			||||||
app.use(express.json());
 | 
					app.use(express.json({ limit: "4mb" }));
 | 
				
			||||||
app.use(bodyParser.text({ limit: "4mb" }));
 | 
					app.use(bodyParser.text());
 | 
				
			||||||
app.use(requestLogger);
 | 
					app.use(requestLogger);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
app.use("/api", apiRouter);
 | 
					app.use("/api", apiRouter);
 | 
				
			||||||
 | 
				
			|||||||
@ -7,7 +7,7 @@ import { RequestHandler } from "express";
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
export const importController: RequestHandler = async (req, res) => {
 | 
					export const importController: RequestHandler = async (req, res) => {
 | 
				
			||||||
    const accountId = await getAccountIdForRequest(req);
 | 
					    const accountId = await getAccountIdForRequest(req);
 | 
				
			||||||
    const request = JSON.parse(String(req.body)) as IImportRequest;
 | 
					    const request = req.body as IImportRequest;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const inventory = await getInventory(accountId);
 | 
					    const inventory = await getInventory(accountId);
 | 
				
			||||||
    importInventory(inventory, request.inventory);
 | 
					    importInventory(inventory, request.inventory);
 | 
				
			||||||
 | 
				
			|||||||
@ -1094,7 +1094,7 @@ function doImport() {
 | 
				
			|||||||
    revalidateAuthz(() => {
 | 
					    revalidateAuthz(() => {
 | 
				
			||||||
        $.post({
 | 
					        $.post({
 | 
				
			||||||
            url: "/custom/import?" + window.authz,
 | 
					            url: "/custom/import?" + window.authz,
 | 
				
			||||||
            contentType: "text/plain",
 | 
					            contentType: "application/json",
 | 
				
			||||||
            data: JSON.stringify({
 | 
					            data: JSON.stringify({
 | 
				
			||||||
                inventory: JSON.parse($("#import-inventory").val())
 | 
					                inventory: JSON.parse($("#import-inventory").val())
 | 
				
			||||||
            })
 | 
					            })
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user