API creation for Product EventDatas and updating asset files
This commit is contained in:
@@ -5,16 +5,16 @@ import wallItenmModel from "../../../shared/model/assets/wallitems-Model.ts";
|
||||
export class wallItems {
|
||||
static async setWallItems(req: Request, res: Response) {
|
||||
try {
|
||||
const { modeluuid, modelname, position, type, csgposition,csgscale,quaternion,scale,organization } = req.body
|
||||
const { modelUuid, modelName, position, type, csgposition,csgscale,quaternion,scale,organization } = req.body
|
||||
|
||||
|
||||
const findvalue = await wallItenmModel(organization).findOne({ modeluuid: modeluuid})
|
||||
const findvalue = await wallItenmModel(organization).findOne({ modelUuid: modelUuid})
|
||||
|
||||
if (findvalue) {
|
||||
const updatevalue = await wallItenmModel(organization).findOneAndUpdate(
|
||||
{ modeluuid: modeluuid },
|
||||
{ modelUuid: modelUuid },
|
||||
{
|
||||
modelname,
|
||||
modelName,
|
||||
position,
|
||||
type,
|
||||
csgposition,
|
||||
@@ -28,7 +28,7 @@ export class wallItems {
|
||||
|
||||
|
||||
} else {
|
||||
const newValue = await wallItenmModel(organization).create({ modeluuid,modelname, position, type, csgposition,csgscale,quaternion,scale });
|
||||
const newValue = await wallItenmModel(organization).create({ modelUuid,modelName, position, type, csgposition,csgscale,quaternion,scale });
|
||||
|
||||
|
||||
res.status(201).json(newValue);
|
||||
@@ -61,11 +61,11 @@ export class wallItems {
|
||||
}
|
||||
static async deleteWallItems(req: Request, res: Response) {
|
||||
try {
|
||||
const { modeluuid,modelname,organization } = req.body;
|
||||
const { modelUuid,modelName,organization } = req.body;
|
||||
|
||||
|
||||
const findValue = await wallItenmModel
|
||||
(organization).findOneAndDelete({modeluuid:modeluuid,modelname:modelname})
|
||||
(organization).findOneAndDelete({modelUuid:modelUuid,modelName:modelName})
|
||||
if (!findValue) {
|
||||
res.status(200).json("user not found");
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user