environments changes
This commit is contained in:
@@ -36,15 +36,15 @@ services:
|
||||
image: mongo:latest
|
||||
container_name: mongo-Dwinzocontainer
|
||||
ports:
|
||||
- "27021:27017"
|
||||
- "27021:27021"
|
||||
volumes:
|
||||
- mongo-data:/data/db
|
||||
networks:
|
||||
- DwinzoMajor # Mongo is now on the same network
|
||||
|
||||
volumes:
|
||||
mongo-data: # Persistent volume for MongoDB data
|
||||
|
||||
volumes:
|
||||
mongo-data: # Persistent volume for MongoDB data
|
||||
networks:
|
||||
DwinzoMajor:
|
||||
driver: bridge
|
||||
|
||||
@@ -4,7 +4,7 @@ import environmentModel from "../../../shared/model/environments/environments-Mo
|
||||
export class environment {
|
||||
static async setEnvironment(req: Request, res: Response) {
|
||||
try {
|
||||
const { userId,roofVisibility,wallVisibility, organization } = req.body
|
||||
const { userId,roofVisibility,wallVisibility,shadowVisibity, organization } = req.body
|
||||
|
||||
|
||||
const findvalue = await environmentModel(organization).findOne({ userId: userId })
|
||||
@@ -12,12 +12,12 @@ export class environment {
|
||||
if (findvalue) {
|
||||
|
||||
const updatevalue = await environmentModel(organization).findOneAndUpdate(
|
||||
{ userId: userId }, { roofVisibility:roofVisibility,wallVisibility:wallVisibility }, { new: true });
|
||||
{ userId: userId }, { roofVisibility:roofVisibility,wallVisibility:wallVisibility,shadowVisibity:shadowVisibity}, { new: true });
|
||||
res.status(201).json(updatevalue);
|
||||
|
||||
|
||||
} else {
|
||||
const newValue = await environmentModel(organization).create({ userId, roofVisibility, wallVisibility });
|
||||
const newValue = await environmentModel(organization).create({ userId, roofVisibility, wallVisibility,shadowVisibity });
|
||||
|
||||
|
||||
res.status(201).json(newValue);
|
||||
|
||||
@@ -12,6 +12,7 @@ const environmentSchema: Schema = new Schema({
|
||||
userId: { type: String, unique: true },
|
||||
roofVisibility: { type: Boolean ,default:false},
|
||||
wallVisibility: { type: Boolean ,default:false},
|
||||
shadowVisibity: { type: Boolean ,default:false},
|
||||
});
|
||||
|
||||
// Model for MongoDB collection
|
||||
|
||||
@@ -3,7 +3,7 @@ export default async function mongoAdminCreation() {
|
||||
const uri = process.env.MONGO_URI!; // Replace with your MongoDB URI
|
||||
const client = new MongoClient(uri);
|
||||
const user = {
|
||||
user: process.env.MONGO_USER!,
|
||||
user:"admin",
|
||||
pwd: process.env.MONGO_PASSWORD!,
|
||||
roles: [{ role: "root", db: process.env.MONGO_AUTH_DB || "admin" }],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user