my-typescript-library-rahul52us 1.3.6 → 1.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/repository/schemas/form.schema.js +10 -1
- package/dist/repository/schemas/form.schema.js.map +1 -1
- package/dist/repository/schemas/profile.schema.js +10 -1
- package/dist/repository/schemas/profile.schema.js.map +1 -1
- package/dist/repository/schemas/role.schema.js +10 -1
- package/dist/repository/schemas/role.schema.js.map +1 -1
- package/dist/types/repository/profile.repository.d.ts +1 -29
- package/dist/types/repository/role.repository.d.ts +1 -3
- package/dist/types/repository/schemas/form.schema.d.ts +2 -2
- package/dist/types/repository/schemas/profile.schema.d.ts +2 -2
- package/dist/types/repository/schemas/role.schema.d.ts +2 -2
- package/dist/types/services/roles/role.services.d.ts +1 -29
- package/package.json +1 -1
- package/src/repository/schemas/form.schema.ts +14 -1
- package/src/repository/schemas/profile.schema.ts +12 -1
- package/src/repository/schemas/role.schema.ts +14 -1
- package/src/services/authentication/register.service.ts +1 -0
- package/src/services/workflow/workflow.service.ts +44 -39
|
@@ -34,5 +34,14 @@ const formSchema = new mongoose_1.default.Schema({
|
|
|
34
34
|
type: Date
|
|
35
35
|
},
|
|
36
36
|
});
|
|
37
|
-
|
|
37
|
+
let Form;
|
|
38
|
+
if (mongoose_1.default.models.Form) {
|
|
39
|
+
console.log("Form model already exists.");
|
|
40
|
+
Form = mongoose_1.default.models.Form;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
console.log("Creating Log model fallback.");
|
|
44
|
+
Form = mongoose_1.default.model("Form", formSchema);
|
|
45
|
+
}
|
|
46
|
+
exports.default = Form;
|
|
38
47
|
//# sourceMappingURL=form.schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.schema.js","sourceRoot":"","sources":["../../../src/repository/schemas/form.schema.ts"],"names":[],"mappings":";;;;;AAAA,wDAA+B;AAE/B,MAAM,UAAU,GAAG,IAAI,k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G;QACL,IAAI,EAAG,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK;KACrC;IACD,UAAU,EAAE;QACR,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI,CAAC,GAAG;KACpB;IACD,UAAU,EAAG;QACT,IAAI,EAAG,IAAI;KACd;IACD,SAAS,EAAE;QACP,IAAI,EAAE,IAAI;KACb;CACJ,CAAC,CAAA;AAGF,IAAI,IAAyB,CAAC;AAE9B,IAAI,kBAAQ,CAAC,MAAM,CAAC,IAAI,EAAE;IACxB,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;IAC1C,IAAI,GAAG,kBAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;CAC7B;KAAM;IACL,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;IAC5C,IAAI,GAAG,kBAAQ,CAAC,KAAK,CAAM,MAAM,EAAE,UAAU,CAAC,CAAC;CAChD;AAED,kBAAe,IAAI,CAAC"}
|
|
@@ -49,5 +49,14 @@ const profileSchema = new mongoose_1.default.Schema({
|
|
|
49
49
|
type: String,
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
|
-
|
|
52
|
+
let Profile;
|
|
53
|
+
if (mongoose_1.default.models.Profile) {
|
|
54
|
+
console.log("Profile model already exists.");
|
|
55
|
+
Profile = mongoose_1.default.models.Profile;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
console.log("Creating RoleModal model fallback.");
|
|
59
|
+
Profile = mongoose_1.default.model("Profile", profileSchema);
|
|
60
|
+
}
|
|
61
|
+
exports.default = Profile;
|
|
53
62
|
//# sourceMappingURL=profile.schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.schema.js","sourceRoot":"","sources":["../../../src/repository/schemas/profile.schema.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4D;AAiB3D,CAAC;AAEF,MAAM,aAAa,GAAW,IAAI,kBAAQ,CAAC,MAAM,CAAC;IAC9C,IAAI,EAAE;QACF,IAAI,EAAE,MAAM;KACf;IACD,KAAK,EAAE;QACH,IAAI,EAAE,MAAM;KACf;IACD,YAAY,EAAE;QACV,IAAI,EAAE,MAAM;KACf;IACD,aAAa,EAAE;QACX,IAAI,EAAE,MAAM;KACf;IACD,kBAAkB,EAAE;QAChB,IAAI,EAAE,MAAM;KACf;IACD,kBAAkB,EAAE;QAChB,IAAI,EAAE,MAAM;KACf;IACD,mBAAmB,EAAE;QACjB,IAAI,EAAE,MAAM;KACf;IACD,qBAAqB,EAAE;QACnB,IAAI,EAAE,MAAM;KACf;IACD,qBAAqB,EAAE;QACnB,IAAI,EAAE,MAAM;KACf;IACD,mBAAmB,EAAE;QACjB,IAAI,EAAE,MAAM;KACf;IACD,mBAAmB,EAAE;QACjB,IAAI,EAAE,MAAM;KACf;IACD,oBAAoB,EAAE;QAClB,IAAI,EAAE,MAAM;KACf;IACD,sBAAsB,EAAE;QACpB,IAAI,EAAE,MAAM;KACf;IACD,sBAAsB,EAAE;QACpB,IAAI,EAAE,MAAM;KACf;CACJ,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"profile.schema.js","sourceRoot":"","sources":["../../../src/repository/schemas/profile.schema.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4D;AAiB3D,CAAC;AAEF,MAAM,aAAa,GAAW,IAAI,kBAAQ,CAAC,MAAM,CAAC;IAC9C,IAAI,EAAE;QACF,IAAI,EAAE,MAAM;KACf;IACD,KAAK,EAAE;QACH,IAAI,EAAE,MAAM;KACf;IACD,YAAY,EAAE;QACV,IAAI,EAAE,MAAM;KACf;IACD,aAAa,EAAE;QACX,IAAI,EAAE,MAAM;KACf;IACD,kBAAkB,EAAE;QAChB,IAAI,EAAE,MAAM;KACf;IACD,kBAAkB,EAAE;QAChB,IAAI,EAAE,MAAM;KACf;IACD,mBAAmB,EAAE;QACjB,IAAI,EAAE,MAAM;KACf;IACD,qBAAqB,EAAE;QACnB,IAAI,EAAE,MAAM;KACf;IACD,qBAAqB,EAAE;QACnB,IAAI,EAAE,MAAM;KACf;IACD,mBAAmB,EAAE;QACjB,IAAI,EAAE,MAAM;KACf;IACD,mBAAmB,EAAE;QACjB,IAAI,EAAE,MAAM;KACf;IACD,oBAAoB,EAAE;QAClB,IAAI,EAAE,MAAM;KACf;IACD,sBAAsB,EAAE;QACpB,IAAI,EAAE,MAAM;KACf;IACD,sBAAsB,EAAE;QACpB,IAAI,EAAE,MAAM;KACf;CACJ,CAAC,CAAA;AAGF,IAAI,OAA4B,CAAC;AAEjC,IAAI,kBAAQ,CAAC,MAAM,CAAC,OAAO,EAAE;IAC3B,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;IAC7C,OAAO,GAAG,kBAAQ,CAAC,MAAM,CAAC,OAA8B,CAAC;CAC1D;KAAM;IACL,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;IAClD,OAAO,GAAG,kBAAQ,CAAC,KAAK,CAAM,SAAS,EAAE,aAAa,CAAC,CAAC;CACzD;AAED,kBAAe,OAAO,CAAC"}
|
|
@@ -35,5 +35,14 @@ const RoleSchema = new mongoose_1.default.Schema({
|
|
|
35
35
|
type: Date,
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
|
-
|
|
38
|
+
let RoleModal;
|
|
39
|
+
if (mongoose_1.default.models.Role) {
|
|
40
|
+
console.log("Role model already exists.");
|
|
41
|
+
RoleModal = mongoose_1.default.models.Role;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
console.log("Creating RoleModal model fallback.");
|
|
45
|
+
RoleModal = mongoose_1.default.model("Role", RoleSchema);
|
|
46
|
+
}
|
|
47
|
+
exports.default = RoleModal;
|
|
39
48
|
//# sourceMappingURL=role.schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"role.schema.js","sourceRoot":"","sources":["../../../src/repository/schemas/role.schema.ts"],"names":[],"mappings":";;;;;AAAA,wDAAsD;AAYtD,MAAM,UAAU,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KAAK,CAAC,QAAQ;QACpC,QAAQ,EAAE,CAAC,IAAI,EAAE,uBAAuB,CAAC;QACzC,GAAG,EAAE,cAAc;KACtB;IACD,QAAQ,EAAE;QACN,IAAI,EAAE,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ;QACpC,GAAG,EAAE,MAAM;KACd;IACD,SAAS,EAAE;QACP,IAAI,EAAE,IAAI;KACb;IACD,SAAS,EAAE;QACP,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI,CAAC,GAAG;KACpB;IACD,SAAS,EAAE;QACP,IAAI,EAAE,IAAI;KACb;CACJ,CAAC,CAAC;AAIH,IAAI,SAA8B,CAAC;AAEnC,IAAI,kBAAQ,CAAC,MAAM,CAAC,IAAI,EAAE;IACxB,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;IAC1C,SAAS,GAAG,kBAAQ,CAAC,MAAM,CAAC,IAA2B,CAAC;CACzD;KAAM;IACL,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;IAClD,SAAS,GAAG,kBAAQ,CAAC,KAAK,CAAM,MAAM,EAAE,UAAU,CAAC,CAAC;CACrD;AAED,kBAAe,SAAS,CAAC"}
|
|
@@ -1,29 +1,3 @@
|
|
|
1
|
-
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
-
/// <reference types="mongoose/types/callback" />
|
|
3
|
-
/// <reference types="mongoose/types/collection" />
|
|
4
|
-
/// <reference types="mongoose/types/connection" />
|
|
5
|
-
/// <reference types="mongoose/types/cursor" />
|
|
6
|
-
/// <reference types="mongoose/types/document" />
|
|
7
|
-
/// <reference types="mongoose/types/error" />
|
|
8
|
-
/// <reference types="mongoose/types/expressions" />
|
|
9
|
-
/// <reference types="mongoose/types/helpers" />
|
|
10
|
-
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
-
/// <reference types="mongoose/types/indexes" />
|
|
12
|
-
/// <reference types="mongoose/types/models" />
|
|
13
|
-
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
-
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
-
/// <reference types="mongoose/types/populate" />
|
|
16
|
-
/// <reference types="mongoose/types/query" />
|
|
17
|
-
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
-
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
-
/// <reference types="mongoose/types/session" />
|
|
20
|
-
/// <reference types="mongoose/types/types" />
|
|
21
|
-
/// <reference types="mongoose/types/utility" />
|
|
22
|
-
/// <reference types="mongoose/types/validation" />
|
|
23
|
-
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
-
/// <reference types="mongoose" />
|
|
25
|
-
/// <reference types="passport-local-mongoose" />
|
|
26
|
-
/// <reference types="mongoose/types/inferschematype" />
|
|
27
1
|
import { profile } from './schemas/profile.schema';
|
|
28
2
|
export type accountDetailsData = {
|
|
29
3
|
name: string;
|
|
@@ -43,7 +17,5 @@ export type accountDetailsData = {
|
|
|
43
17
|
};
|
|
44
18
|
export declare function createProfile(accountDetailsData: profile): Promise<any>;
|
|
45
19
|
export declare function updateProfile(id: string, data: accountDetailsData): Promise<any>;
|
|
46
|
-
export declare function getProfile(id: string): Promise<
|
|
47
|
-
_id: import("mongoose").Types.ObjectId;
|
|
48
|
-
})>;
|
|
20
|
+
export declare function getProfile(id: string): Promise<any>;
|
|
49
21
|
export declare function getAllProfile(searchValue: string): Promise<any>;
|
|
@@ -3,9 +3,7 @@ import mongoose from 'mongoose';
|
|
|
3
3
|
export { IRole };
|
|
4
4
|
export declare function createRolePermission(data: IRole): Promise<mongoose.Types.ObjectId | Error>;
|
|
5
5
|
export declare function updateRolePermission(id: string, data: Partial<IRole>): Promise<any>;
|
|
6
|
-
export declare function getRole(id: string): Promise<
|
|
7
|
-
_id: mongoose.Types.ObjectId;
|
|
8
|
-
})>;
|
|
6
|
+
export declare function getRole(id: string): Promise<any>;
|
|
9
7
|
export declare function deleteRolePermission(id: string): Promise<any>;
|
|
10
8
|
export declare function getRolePermission(id: string): Promise<any>;
|
|
11
9
|
export declare function getAllRolePermissions(searchValue: string, company: string, sort: string | null, skip: string | null, limit: string | null): Promise<IRole[]>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import mongoose from 'mongoose';
|
|
2
|
-
declare
|
|
3
|
-
export default
|
|
2
|
+
declare let Form: mongoose.Model<any>;
|
|
3
|
+
export default Form;
|
|
@@ -15,5 +15,5 @@ export interface profile extends Document {
|
|
|
15
15
|
shippingAddressCountry: string;
|
|
16
16
|
shippingAddressPinCode: string;
|
|
17
17
|
}
|
|
18
|
-
declare
|
|
19
|
-
export default
|
|
18
|
+
declare let Profile: mongoose.Model<any>;
|
|
19
|
+
export default Profile;
|
|
@@ -1,29 +1,3 @@
|
|
|
1
|
-
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
-
/// <reference types="mongoose/types/callback" />
|
|
3
|
-
/// <reference types="mongoose/types/collection" />
|
|
4
|
-
/// <reference types="mongoose/types/connection" />
|
|
5
|
-
/// <reference types="mongoose/types/cursor" />
|
|
6
|
-
/// <reference types="mongoose/types/document" />
|
|
7
|
-
/// <reference types="mongoose/types/error" />
|
|
8
|
-
/// <reference types="mongoose/types/expressions" />
|
|
9
|
-
/// <reference types="mongoose/types/helpers" />
|
|
10
|
-
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
-
/// <reference types="mongoose/types/indexes" />
|
|
12
|
-
/// <reference types="mongoose/types/models" />
|
|
13
|
-
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
-
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
-
/// <reference types="mongoose/types/populate" />
|
|
16
|
-
/// <reference types="mongoose/types/query" />
|
|
17
|
-
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
-
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
-
/// <reference types="mongoose/types/session" />
|
|
20
|
-
/// <reference types="mongoose/types/types" />
|
|
21
|
-
/// <reference types="mongoose/types/utility" />
|
|
22
|
-
/// <reference types="mongoose/types/validation" />
|
|
23
|
-
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
-
/// <reference types="mongoose" />
|
|
25
|
-
/// <reference types="passport-local-mongoose" />
|
|
26
|
-
/// <reference types="mongoose/types/inferschematype" />
|
|
27
1
|
import { Request, Response } from 'express';
|
|
28
2
|
interface UserRequest extends Request {
|
|
29
3
|
user?: {
|
|
@@ -33,9 +7,7 @@ interface UserRequest extends Request {
|
|
|
33
7
|
export declare function createRoleService(req: UserRequest, res: Response): Promise<any>;
|
|
34
8
|
export declare function getRoleById(Id: string): Promise<{
|
|
35
9
|
success: boolean;
|
|
36
|
-
data:
|
|
37
|
-
_id: import("mongoose").Types.ObjectId;
|
|
38
|
-
});
|
|
10
|
+
data: any;
|
|
39
11
|
error?: undefined;
|
|
40
12
|
} | {
|
|
41
13
|
success: boolean;
|
package/package.json
CHANGED
|
@@ -31,4 +31,17 @@ const formSchema = new mongoose.Schema({
|
|
|
31
31
|
},
|
|
32
32
|
})
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
|
|
35
|
+
let Form: mongoose.Model<any>;
|
|
36
|
+
|
|
37
|
+
if (mongoose.models.Form) {
|
|
38
|
+
console.log("Form model already exists.");
|
|
39
|
+
Form = mongoose.models.Form;
|
|
40
|
+
} else {
|
|
41
|
+
console.log("Creating Log model fallback.");
|
|
42
|
+
Form = mongoose.model<any>("Form", formSchema);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default Form;
|
|
46
|
+
|
|
47
|
+
|
|
@@ -62,4 +62,15 @@ const profileSchema: Schema = new mongoose.Schema({
|
|
|
62
62
|
}
|
|
63
63
|
})
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
|
|
66
|
+
let Profile: mongoose.Model<any>;
|
|
67
|
+
|
|
68
|
+
if (mongoose.models.Profile) {
|
|
69
|
+
console.log("Profile model already exists.");
|
|
70
|
+
Profile = mongoose.models.Profile as mongoose.Model<any>;
|
|
71
|
+
} else {
|
|
72
|
+
console.log("Creating RoleModal model fallback.");
|
|
73
|
+
Profile = mongoose.model<any>("Profile", profileSchema);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export default Profile;
|
|
@@ -42,4 +42,17 @@ const RoleSchema: Schema = new mongoose.Schema({
|
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
let RoleModal: mongoose.Model<any>;
|
|
48
|
+
|
|
49
|
+
if (mongoose.models.Role) {
|
|
50
|
+
console.log("Role model already exists.");
|
|
51
|
+
RoleModal = mongoose.models.Role as mongoose.Model<any>;
|
|
52
|
+
} else {
|
|
53
|
+
console.log("Creating RoleModal model fallback.");
|
|
54
|
+
RoleModal = mongoose.model<any>("Role", RoleSchema);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export default RoleModal;
|
|
58
|
+
|
|
@@ -107,52 +107,54 @@ export async function generateWorkflow(req: any) {
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
if (approval.isText === 1 && !approval.isActive) {
|
|
110
|
-
let tokenVerifyEmail = sign({
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
const template = await compileEmailTemplate({
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
await Promise.all([
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
]);
|
|
135
|
-
dt = {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
};
|
|
110
|
+
// let tokenVerifyEmail = sign({
|
|
111
|
+
// email: approval.username,
|
|
112
|
+
// name: approval.username,
|
|
113
|
+
// });
|
|
114
|
+
|
|
115
|
+
// const template = await compileEmailTemplate({
|
|
116
|
+
// fileName: "verifyEmail.mjml",
|
|
117
|
+
// data: {
|
|
118
|
+
// name: approval.username,
|
|
119
|
+
// url: `${process.env.FRONTEND_URL}/verify-email?token=${tokenVerifyEmail}`,
|
|
120
|
+
// },
|
|
121
|
+
// });
|
|
122
|
+
|
|
123
|
+
// await Promise.all([
|
|
124
|
+
// sendMail(
|
|
125
|
+
// approval.username,
|
|
126
|
+
// "Confirm your email address",
|
|
127
|
+
// template
|
|
128
|
+
// ),
|
|
129
|
+
// createToken(
|
|
130
|
+
// response.data,
|
|
131
|
+
// tokenVerifyEmail,
|
|
132
|
+
// SEND_MAIL_TYPE.VERIFY_EMAIL
|
|
133
|
+
// ),
|
|
134
|
+
// ]);
|
|
135
|
+
// dt = {
|
|
136
|
+
// ...dt,
|
|
137
|
+
// verifyTokenUrl: `${process.env.FRONTEND_URL}/verify-email?token=${tokenVerifyEmail}`,
|
|
138
|
+
// };
|
|
139
139
|
}
|
|
140
|
-
const template = await compileEmailTemplate({
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
});
|
|
140
|
+
// const template = await compileEmailTemplate({
|
|
141
|
+
// fileName: "workflowTeamMember.mjml",
|
|
142
|
+
// data: dt,
|
|
143
|
+
// });
|
|
144
144
|
|
|
145
|
-
sendMail(
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
);
|
|
145
|
+
// sendMail(
|
|
146
|
+
// approval.username,
|
|
147
|
+
// `Get Started with ${req.body.workFlowName} Workflow Now!`,
|
|
148
|
+
// template
|
|
149
|
+
// );
|
|
150
150
|
|
|
151
151
|
let { selectMode, addNew, isText, password, ...rest } = approval;
|
|
152
152
|
approvalsData.push({ user: response.data, ...rest });
|
|
153
153
|
} else {
|
|
154
154
|
}
|
|
155
|
-
} catch (err) {
|
|
155
|
+
} catch (err) {
|
|
156
|
+
console.log("the err are", err)
|
|
157
|
+
}
|
|
156
158
|
})
|
|
157
159
|
);
|
|
158
160
|
}
|
|
@@ -168,6 +170,9 @@ export async function generateWorkflow(req: any) {
|
|
|
168
170
|
});
|
|
169
171
|
|
|
170
172
|
req.body.approvals = approvalsData;
|
|
173
|
+
|
|
174
|
+
console.log('the approvals are',req.body.approvals)
|
|
175
|
+
|
|
171
176
|
await updateWorkFlow(workflow._id, data);
|
|
172
177
|
|
|
173
178
|
return {
|