vizualization updates
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import mongoose, { Document, Schema } from 'mongoose';
|
||||
import MainModel from '../../connect/mongoose';
|
||||
import MainModel from '../../connect/mongoose.ts';
|
||||
|
||||
// Interface for TypeScript with PascalCase
|
||||
export interface floorItenms extends Document {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import mongoose, { Document, Schema } from 'mongoose';
|
||||
import MainModel from '../../connect/mongoose';
|
||||
import MainModel from '../../connect/mongoose.ts';
|
||||
// Interface for TypeScript with PascalCase
|
||||
export interface wallitems extends Document {
|
||||
modeluuid: string;
|
||||
|
||||
62
src/shared/model/builder/assets/asset-Model.ts
Normal file
62
src/shared/model/builder/assets/asset-Model.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
import mongoose, { Document, Schema } from "mongoose";
|
||||
import MainModel from "../../../connect/mongoose.ts";
|
||||
|
||||
// Interface for TypeScript with PascalCase
|
||||
export interface assetData extends Document {
|
||||
modeluuid: string;
|
||||
modelfileID: string;
|
||||
modelname: string;
|
||||
isLocked: boolean;
|
||||
isVisible: boolean;
|
||||
position: [];
|
||||
rotation: {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
};
|
||||
points: [
|
||||
{
|
||||
uuid: string;
|
||||
position: [];
|
||||
rotation: [];
|
||||
actions: [mongoose.Types.ObjectId];
|
||||
triggers: [mongoose.Types.ObjectId];
|
||||
// connections:{
|
||||
// source:{
|
||||
// pathuuid:string,pointuuid:string
|
||||
// },
|
||||
// target:[]
|
||||
// }
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
// Define the Mongoose Schema
|
||||
const assetDataSchema: Schema = new Schema({
|
||||
modeluuid: { type: String },
|
||||
modelfileID: { type: String },
|
||||
modelname: { type: String },
|
||||
position: { type: Array },
|
||||
points: [
|
||||
{
|
||||
uuid: { type: String },
|
||||
position: { type: Array },
|
||||
rotation: { type: Array },
|
||||
actions: [{ type: mongoose.Schema.Types.ObjectId, ref: "Widget" }],
|
||||
triggers: [{ type: mongoose.Schema.Types.ObjectId, ref: "Widget" }],
|
||||
},
|
||||
],
|
||||
isLocked: { type: Boolean },
|
||||
isVisible: { type: Boolean },
|
||||
rotation: {
|
||||
x: { type: Number, required: true },
|
||||
y: { type: Number, required: true },
|
||||
z: { type: Number, required: true },
|
||||
},
|
||||
});
|
||||
|
||||
// export default floorItemsModel;
|
||||
const assetModel = (db: string) => {
|
||||
return MainModel(db, "Assets", assetDataSchema, "Assets");
|
||||
};
|
||||
export default assetModel;
|
||||
59
src/shared/model/builder/assets/pointSchema.ts
Normal file
59
src/shared/model/builder/assets/pointSchema.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import mongoose, { Document, Schema } from "mongoose";
|
||||
import MainModel from "../../../connect/mongoose.ts";
|
||||
|
||||
// Interface for TypeScript with PascalCase
|
||||
export interface Points extends Document {
|
||||
modelfileID: string;
|
||||
points: {
|
||||
uuid: string;
|
||||
position: number[];
|
||||
rotation: number[];
|
||||
actions: string[];
|
||||
triggers: string[];
|
||||
}[];
|
||||
}
|
||||
const defaultPoints = [
|
||||
{
|
||||
uuid: "",
|
||||
position: [0, 1.25, 3.3],
|
||||
rotation: [0, 0, 0],
|
||||
actions: [],
|
||||
triggers: [],
|
||||
},
|
||||
{
|
||||
uuid: "",
|
||||
position: [0, 1.25, 3.3],
|
||||
rotation: [0, 0, 0],
|
||||
actions: [],
|
||||
triggers: [],
|
||||
},
|
||||
{
|
||||
uuid: "",
|
||||
position: [0, 1.25, 3.3],
|
||||
rotation: [0, 0, 0],
|
||||
actions: [],
|
||||
triggers: [],
|
||||
},
|
||||
];
|
||||
// Define the Mongoose Schema
|
||||
const pointSchema: Schema = new Schema({
|
||||
modelfileID: { type: String, required: true },
|
||||
points: {
|
||||
type: [
|
||||
{
|
||||
uuid: { type: String },
|
||||
position: { type: [Number], default: [0, 1.25, 3.3] },
|
||||
rotation: { type: [Number], default: [0, 0, 0] },
|
||||
actions: { type: [String], default: [] },
|
||||
triggers: { type: [String], default: [] },
|
||||
},
|
||||
],
|
||||
default: defaultPoints,
|
||||
},
|
||||
});
|
||||
|
||||
const pointModel = (db: string) => {
|
||||
return MainModel(db, "Points", pointSchema, "Points");
|
||||
};
|
||||
|
||||
export default pointModel;
|
||||
31
src/shared/model/builder/assets/wallitems-Model.ts
Normal file
31
src/shared/model/builder/assets/wallitems-Model.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import mongoose, { Document, Schema } from "mongoose";
|
||||
import MainModel from "../../../connect/mongoose.ts";
|
||||
// Interface for TypeScript with PascalCase
|
||||
export interface wallitems extends Document {
|
||||
modeluuid: string;
|
||||
modelname: string;
|
||||
type: string;
|
||||
csgposition: [];
|
||||
csgscale: [];
|
||||
position: [];
|
||||
quaternion: [];
|
||||
scale: [];
|
||||
}
|
||||
|
||||
// Define the Mongoose Schema
|
||||
const wallItemsSchema: Schema = new Schema({
|
||||
modeluuid: { type: String, unique: true },
|
||||
modelname: { type: String },
|
||||
type: { type: String },
|
||||
csgposition: { type: Array },
|
||||
csgscale: { type: Array },
|
||||
position: { type: Array },
|
||||
quaternion: { type: Array },
|
||||
scale: { type: Array },
|
||||
});
|
||||
|
||||
// export default wallItenmModel;
|
||||
const wallItenmModel = (db: string) => {
|
||||
return MainModel(db, "wallitems", wallItemsSchema, "wallitems");
|
||||
};
|
||||
export default wallItenmModel;
|
||||
48
src/shared/model/builder/camera/camera-Model.ts
Normal file
48
src/shared/model/builder/camera/camera-Model.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import mongoose, { Document, Schema } from "mongoose";
|
||||
import MainModel from "../../../connect/mongoose.ts";
|
||||
|
||||
// Interface for TypeScript with PascalCase
|
||||
export interface Camera extends Document {
|
||||
userId: string;
|
||||
position: {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
};
|
||||
target: {
|
||||
x: { type: Number; required: true };
|
||||
y: { type: Number; required: true };
|
||||
z: { type: Number; required: true };
|
||||
};
|
||||
rotation: {
|
||||
x: { type: Number; required: true };
|
||||
y: { type: Number; required: true };
|
||||
z: { type: Number; required: true };
|
||||
};
|
||||
}
|
||||
|
||||
// Define the Mongoose Schema
|
||||
const cameraSchema: Schema = new Schema({
|
||||
userId: { type: String },
|
||||
position: {
|
||||
x: { type: Number, required: true },
|
||||
y: { type: Number, required: true },
|
||||
z: { type: Number, required: true },
|
||||
},
|
||||
target: {
|
||||
x: { type: Number, required: true },
|
||||
y: { type: Number, required: true },
|
||||
z: { type: Number, required: true },
|
||||
},
|
||||
rotation: {
|
||||
x: { type: Number, required: true },
|
||||
y: { type: Number, required: true },
|
||||
z: { type: Number, required: true },
|
||||
},
|
||||
});
|
||||
|
||||
// export default cameraModel
|
||||
const cameraModel = (db: string) => {
|
||||
return MainModel(db, "Camera", cameraSchema, "Camera");
|
||||
};
|
||||
export default cameraModel;
|
||||
24
src/shared/model/builder/environments/environments-Model.ts
Normal file
24
src/shared/model/builder/environments/environments-Model.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import mongoose, { Document, Schema } from 'mongoose';
|
||||
import MainModel from '../../../connect/mongoose.ts';
|
||||
// Interface for TypeScript with PascalCase
|
||||
export interface environment extends Document {
|
||||
userId: string;
|
||||
roofVisibility: boolean
|
||||
wallVisibility: boolean
|
||||
}
|
||||
|
||||
// Define the Mongoose Schema
|
||||
const environmentSchema: Schema = new Schema({
|
||||
userId: { type: String, unique: true },
|
||||
roofVisibility: { type: Boolean, default: false },
|
||||
wallVisibility: { type: Boolean, default: false },
|
||||
shadowVisibility: { type: Boolean, default: false },
|
||||
});
|
||||
|
||||
|
||||
|
||||
// export default environmentModel;
|
||||
const environmentModel = (db: string) => {
|
||||
return MainModel(db, "environments", environmentSchema, "environments")
|
||||
};
|
||||
export default environmentModel;
|
||||
26
src/shared/model/builder/lines/lines-Model.ts
Normal file
26
src/shared/model/builder/lines/lines-Model.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import mongoose, { Document, Schema } from "mongoose";
|
||||
import MainModel from "../../../connect/mongoose.ts";
|
||||
const positionSchema = new mongoose.Schema({
|
||||
x: { type: Number }, // Optional position fields
|
||||
y: { type: Number },
|
||||
z: { type: Number },
|
||||
});
|
||||
|
||||
// Define a schema for the individual line
|
||||
const Vector3 = new mongoose.Schema({
|
||||
position: { type: positionSchema, required: false }, // Optional position
|
||||
uuid: { type: String, required: false }, // Optional uuid
|
||||
});
|
||||
|
||||
// Define the main schema
|
||||
const LineSchema = new mongoose.Schema({
|
||||
layer: { type: Number, required: true }, // Layer is mandatory
|
||||
line: { type: [Vector3], required: true }, // Array of line objects
|
||||
type: { type: String, required: false }, // Optional type
|
||||
});
|
||||
|
||||
// export default lineModel;
|
||||
const lineModel = (db: string) => {
|
||||
return MainModel(db, "lines", LineSchema, "lines");
|
||||
};
|
||||
export default lineModel;
|
||||
84
src/shared/model/builder/lines/zone-Model.ts
Normal file
84
src/shared/model/builder/lines/zone-Model.ts
Normal file
@@ -0,0 +1,84 @@
|
||||
// import mongoose, { Schema, Document, model } from "mongoose";
|
||||
// import MainModel from "../../../connect/mongoose.ts";
|
||||
|
||||
// export interface Zone extends Document {
|
||||
// zoneName: string;
|
||||
// // zoneUUID: string;
|
||||
// zonePoints: [];
|
||||
// centerPoints: [];
|
||||
// isArchive: boolean;
|
||||
// createdBy: string;
|
||||
// sceneID: string;
|
||||
// // createdBy: mongoose.Types.ObjectId;
|
||||
// // sceneID: mongoose.Types.ObjectId;
|
||||
// layer: number;
|
||||
// }
|
||||
// const zoneSchema: Schema = new Schema(
|
||||
// {
|
||||
// zoneName: { type: String },
|
||||
// // zoneUUID: { type: String },
|
||||
// createdBy: { type: String },
|
||||
// sceneID: { type: String },
|
||||
// layer: { type: Number },
|
||||
// centerPoints: { type: Array },
|
||||
// zonePoints: { type: Array },
|
||||
// isArchive: { type: Boolean, default: false },
|
||||
// // createdBy: { type: mongoose.Schema.Types.ObjectId, ref: "User" },
|
||||
// // sceneID: { type: mongoose.Schema.Types.ObjectId, ref: "Scene" },
|
||||
// },
|
||||
// { timestamps: true }
|
||||
// );
|
||||
|
||||
// const dataModel = (db: any) => {
|
||||
// return MainModel(db, "Zones", zoneSchema, "Zones");
|
||||
// };
|
||||
// export default dataModel;
|
||||
|
||||
import mongoose, { Schema, Document, model } from "mongoose";
|
||||
import MainModel from "../../../connect/mongoose.ts";
|
||||
|
||||
export interface Zone extends Document {
|
||||
zoneName: string;
|
||||
zoneId: string;
|
||||
zonePoints: [];
|
||||
viewPortCenter: [];
|
||||
viewPortposition: [];
|
||||
isArchive: boolean;
|
||||
createdBy: string;
|
||||
sceneID: string;
|
||||
panelOrder: string[];
|
||||
lockedPanel: string[];
|
||||
// createdBy: mongoose.Types.ObjectId;
|
||||
// sceneID: mongoose.Types.ObjectId;
|
||||
layer: number;
|
||||
}
|
||||
const zoneSchema: Schema = new Schema(
|
||||
{
|
||||
zoneName: { type: String },
|
||||
zoneId: { type: String },
|
||||
createdBy: { type: String },
|
||||
sceneID: { type: String },
|
||||
layer: { type: Number },
|
||||
points: { type: Array },
|
||||
isArchive: { type: Boolean, default: false },
|
||||
panelOrder: {
|
||||
type: [String],
|
||||
enum: ["left", "right", "up", "down"],
|
||||
},
|
||||
viewPortCenter: { type: Array, required: true },
|
||||
viewPortposition: { type: Array, required: true },
|
||||
lockedPanel: {
|
||||
type: [String],
|
||||
default: [],
|
||||
enum: ["left", "right", "up", "down"],
|
||||
},
|
||||
// createdBy: { type: mongoose.Schema.Types.ObjectId, ref: "User" },
|
||||
// sceneID: { type: mongoose.Schema.Types.ObjectId, ref: "Scene" },
|
||||
},
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
const zoneModel = (db: any) => {
|
||||
return MainModel(db, "zones", zoneSchema, "zones");
|
||||
};
|
||||
export default zoneModel;
|
||||
@@ -1,5 +1,5 @@
|
||||
import mongoose, { Document, Schema } from 'mongoose';
|
||||
import MainModel from '../../connect/mongoose';
|
||||
import MainModel from '../../connect/mongoose.ts';
|
||||
|
||||
// Interface for TypeScript with PascalCase
|
||||
export interface Camera extends Document {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import mongoose, { Document, Schema } from 'mongoose';
|
||||
import MainModel from '../../connect/mongoose';
|
||||
import MainModel from '../../connect/mongoose.ts';
|
||||
// Interface for TypeScript with PascalCase
|
||||
export interface environment extends Document {
|
||||
userId: string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import mongoose, { Document, Schema } from "mongoose";
|
||||
import MainModel from "../../connect/mongoose";
|
||||
import MainModel from "../../connect/mongoose.ts";
|
||||
const positionSchema = new mongoose.Schema({
|
||||
x: { type: Number, }, // Optional position fields
|
||||
y: { type: Number, },
|
||||
|
||||
@@ -1,25 +1,27 @@
|
||||
import mongoose, { Document, ObjectId, Schema } from "mongoose";
|
||||
import MainModel from "../../connect/mongoose";
|
||||
import MainModel from "../../connect/mongoose.ts";
|
||||
export interface zoneSchema extends Document {
|
||||
zoneId: string;
|
||||
zoneId: string;//UUID
|
||||
zoneName: string
|
||||
createBy: mongoose.Types.ObjectId
|
||||
points: []
|
||||
layer: Number
|
||||
viewPortCenter: []
|
||||
viewPortposition: []
|
||||
isArchive:boolean
|
||||
|
||||
}
|
||||
|
||||
// Define the Mongoose Schema
|
||||
const zoneSchema: Schema = new Schema({
|
||||
zoneId: { type: String },
|
||||
zoneId: { type: String },//UUID
|
||||
zoneName: { type: String },
|
||||
createBy: { type: Schema.Types.ObjectId, ref: "Users", },
|
||||
points: { type: Array },
|
||||
layer: { type: Number, required: true },
|
||||
viewPortCenter: { type: Array, required: true },
|
||||
viewPortposition: { type: Array, required: true },
|
||||
isArchive:{type:Boolean,default:false}
|
||||
});
|
||||
|
||||
|
||||
|
||||
39
src/shared/model/simulation/actionmodel.ts
Normal file
39
src/shared/model/simulation/actionmodel.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import mongoose, { Schema, Document, model } from "mongoose";
|
||||
import MainModel from "../../connect/mongoose.ts";
|
||||
|
||||
export interface Event extends Document {
|
||||
pointsUUID: string;
|
||||
actionUUID: string;
|
||||
isArchive: string;
|
||||
sceneID: string;
|
||||
eventData: {
|
||||
uuid: string;
|
||||
type: string;
|
||||
material: string;
|
||||
delay: number;
|
||||
spawn_Interval: number;
|
||||
};
|
||||
}
|
||||
const eventSchema: Schema = new Schema(
|
||||
{
|
||||
pointsUUID: { type: String },
|
||||
isArchive: { type: Boolean, default: false },
|
||||
actionUUID: { type: String },
|
||||
sceneID: { type: String },
|
||||
eventData: [
|
||||
{
|
||||
uuid: { type: String },
|
||||
type: { type: String },
|
||||
material: { type: String },
|
||||
delay: { type: Number },
|
||||
spawn_Interval: { type: Number },
|
||||
},
|
||||
],
|
||||
},
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
const actionModel = (db: any) => {
|
||||
return MainModel(db, "Events", eventSchema, "Events");
|
||||
};
|
||||
export default actionModel;
|
||||
39
src/shared/model/simulation/triggersmodel.ts
Normal file
39
src/shared/model/simulation/triggersmodel.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import mongoose, { Schema, Document, model } from "mongoose";
|
||||
import MainModel from "../../connect/mongoose.ts";
|
||||
|
||||
export interface Trigger extends Document {
|
||||
pointsUUID: string;
|
||||
actionUUID: string;
|
||||
isArchive: string;
|
||||
sceneID: string;
|
||||
triggerData: {
|
||||
uuid: string;
|
||||
type: string;
|
||||
// material: string;
|
||||
// delay: number;
|
||||
// spawn_Interval: number;
|
||||
};
|
||||
}
|
||||
const triggerSchema: Schema = new Schema(
|
||||
{
|
||||
pointsUUID: { type: String },
|
||||
isArchive: { type: Boolean, default: false },
|
||||
actionUUID: { type: String },
|
||||
sceneID: { type: String },
|
||||
triggerData: [
|
||||
{
|
||||
uuid: { type: String },
|
||||
type: { type: String },
|
||||
// material: { type: String },
|
||||
// delay: { type: Number },
|
||||
// spawn_Interval: { type: Number },
|
||||
},
|
||||
],
|
||||
},
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
const triggerModel = (db: any) => {
|
||||
return MainModel(db, "Triggers", triggerSchema, "Triggers");
|
||||
};
|
||||
export default triggerModel;
|
||||
@@ -1,5 +1,5 @@
|
||||
import mongoose, { Document, Schema } from "mongoose";
|
||||
import MainModel from "../connect/mongoose";
|
||||
import MainModel from "../connect/mongoose.ts";
|
||||
export interface User extends Document {
|
||||
userName: String;
|
||||
email: String;
|
||||
|
||||
25
src/shared/model/vizualization/panelmodel.ts
Normal file
25
src/shared/model/vizualization/panelmodel.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import mongoose, { Schema, Document, model } from "mongoose";
|
||||
import MainModel from "../../connect/mongoose.ts";
|
||||
|
||||
export interface Panel extends Document {
|
||||
// zoneId: mongoose.Types.ObjectId;
|
||||
zoneId: string;
|
||||
panelName: string;
|
||||
widgets: [mongoose.Types.ObjectId];
|
||||
isArchive: boolean;
|
||||
}
|
||||
const panelSchema: Schema = new Schema(
|
||||
{
|
||||
// zoneId: { type: mongoose.Schema.Types.ObjectId, ref: "Zone" },
|
||||
zoneId: { type: String },
|
||||
panelName: { type: String },
|
||||
widgets: [{ type: mongoose.Schema.Types.ObjectId, ref: "Widget" }],
|
||||
isArchive: { type: Boolean, default: false },
|
||||
},
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
const panelModel = (db: any) => {
|
||||
return MainModel(db, "Panel", panelSchema, "Panel");
|
||||
};
|
||||
export default panelModel;
|
||||
19
src/shared/model/vizualization/templatemodel.ts
Normal file
19
src/shared/model/vizualization/templatemodel.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import mongoose, { Schema, Document, model } from "mongoose";
|
||||
import MainModel from "../../connect/mongoose.ts";
|
||||
|
||||
export interface Template extends Document {
|
||||
templateName: string;
|
||||
isArchive: boolean;
|
||||
}
|
||||
const templateSchema: Schema = new Schema(
|
||||
{
|
||||
templateName: { type: String },
|
||||
isArchive: { type: Boolean, default: false },
|
||||
},
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
const templateModel = (db: any) => {
|
||||
return MainModel(db, "Template", templateSchema, "Template");
|
||||
};
|
||||
export default templateModel;
|
||||
48
src/shared/model/vizualization/widgemodel.ts
Normal file
48
src/shared/model/vizualization/widgemodel.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import mongoose, { Schema, Document, model } from "mongoose";
|
||||
import MainModel from "../../connect/mongoose.ts";
|
||||
|
||||
export interface widget extends Document {
|
||||
widgetName: string;
|
||||
widgetside: string;
|
||||
widgetID: string;
|
||||
widgetOrder: string;
|
||||
elementType: string;
|
||||
elementColor: string;
|
||||
fontFamily: string;
|
||||
fontStyle: string;
|
||||
fontWeight: string;
|
||||
isArchive: boolean;
|
||||
panelID: mongoose.Types.ObjectId;
|
||||
Data: {
|
||||
measurement: Record<string, any>;
|
||||
duration: string;
|
||||
};
|
||||
}
|
||||
const widgetSchema: Schema = new Schema(
|
||||
{
|
||||
widgetName: { type: String },
|
||||
widgetside: { type: String },
|
||||
widgetID: { type: String },
|
||||
widgetOrder: { type: String },
|
||||
elementType: { type: String },
|
||||
elementColor: { type: String },
|
||||
fontFamily: { type: String },
|
||||
fontStyle: { type: String },
|
||||
Data: {
|
||||
measurements: {
|
||||
type: Object,
|
||||
default: {},
|
||||
},
|
||||
duration: { type: String, default: "1hr" },
|
||||
},
|
||||
fontWeight: { type: String },
|
||||
isArchive: { type: Boolean, default: false },
|
||||
panelID: { type: mongoose.Schema.Types.ObjectId, ref: "Panel" },
|
||||
},
|
||||
{ timestamps: true }
|
||||
);
|
||||
|
||||
const widgetModel = (db: any) => {
|
||||
return MainModel(db, "Widget", widgetSchema, "Widget");
|
||||
};
|
||||
export default widgetModel;
|
||||
@@ -1,16 +1,17 @@
|
||||
const bcrypt = require("bcryptjs");
|
||||
import bcrypt from 'bcryptjs';
|
||||
|
||||
const saltRounds = 10;
|
||||
const hashGenerate = async (Password:String) => {
|
||||
export const hashGenerate = async (Password:string) => {
|
||||
try {
|
||||
const salt = await bcrypt.genSalt(saltRounds);
|
||||
const hash = await bcrypt.hash(Password, salt);
|
||||
|
||||
|
||||
return hash;
|
||||
} catch (error) {
|
||||
return error;
|
||||
}
|
||||
};
|
||||
const hashValidator = async (password:String, hashedPassword:String) => {
|
||||
export const hashValidator = async (password:string, hashedPassword:string) => {
|
||||
|
||||
try {
|
||||
const result = await bcrypt.compare(password, hashedPassword);
|
||||
@@ -20,5 +21,4 @@ const hashValidator = async (password:String, hashedPassword:String) => {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
module.exports.hashGenerate = hashGenerate;
|
||||
module.exports.hashValidator = hashValidator;
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user