@things-factory/work-shift 6.2.49 → 6.2.51
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.
|
@@ -11,7 +11,7 @@ let WorkShiftMutation = class WorkShiftMutation {
|
|
|
11
11
|
const { domain, user, tx } = context.state;
|
|
12
12
|
let results = [];
|
|
13
13
|
const workShiftRepo = tx.getRepository(work_shift_1.WorkShift);
|
|
14
|
-
await workShiftRepo.delete({ domain });
|
|
14
|
+
await workShiftRepo.delete({ domain: { id: domain.id } });
|
|
15
15
|
for (let i = 0; i < patches.length; i++) {
|
|
16
16
|
const patch = patches[i];
|
|
17
17
|
const result = await workShiftRepo.save(Object.assign(Object.assign({}, patch), { domain, creator: user, updater: user }));
|
|
@@ -29,7 +29,7 @@ let WorkShiftMutation = class WorkShiftMutation {
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
tslib_1.__decorate([
|
|
32
|
-
(0, type_graphql_1.Directive)('@privilege(category: "
|
|
32
|
+
(0, type_graphql_1.Directive)('@privilege(category: "work-shift", privilege: "mutation", domainOwnerGranted: true)'),
|
|
33
33
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
34
34
|
(0, type_graphql_1.Mutation)(returns => [work_shift_1.WorkShift], { description: "To modify multiple WorkShifts' information" }),
|
|
35
35
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [work_shift_type_1.WorkShiftPatch])),
|
|
@@ -39,7 +39,7 @@ tslib_1.__decorate([
|
|
|
39
39
|
tslib_1.__metadata("design:returntype", Promise)
|
|
40
40
|
], WorkShiftMutation.prototype, "updateMultipleWorkShift", null);
|
|
41
41
|
tslib_1.__decorate([
|
|
42
|
-
(0, type_graphql_1.Directive)('@privilege(category: "
|
|
42
|
+
(0, type_graphql_1.Directive)('@privilege(category: "work-shift", privilege: "mutation", domainOwnerGranted: true)'),
|
|
43
43
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
44
44
|
(0, type_graphql_1.Mutation)(returns => Boolean, { description: 'To delete multiple workShifts' }),
|
|
45
45
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('ids', type => [String])),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"work-shift-mutation.js","sourceRoot":"","sources":["../../../server/service/work-shift/work-shift-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,6CAAwC;AACxC,uDAAkD;AAG3C,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAItB,AAAN,KAAK,CAAC,uBAAuB,CACe,OAAyB,EAC5D,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,MAAM,aAAa,GAAG,EAAE,CAAC,aAAa,CAAC,sBAAS,CAAC,CAAA;QAEjD,MAAM,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"work-shift-mutation.js","sourceRoot":"","sources":["../../../server/service/work-shift/work-shift-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,6CAAwC;AACxC,uDAAkD;AAG3C,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAItB,AAAN,KAAK,CAAC,uBAAuB,CACe,OAAyB,EAC5D,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,MAAM,aAAa,GAAG,EAAE,CAAC,aAAa,CAAC,sBAAS,CAAC,CAAA;QAEjD,MAAM,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;QAEzD,KAAK,IAAI,CAAC,GAA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EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;IAE5E,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;yDAUP;AA9CU,iBAAiB;IAD7B,IAAA,uBAAQ,EAAC,sBAAS,CAAC;GACP,iBAAiB,CA+C7B;AA/CY,8CAAiB","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { WorkShift } from './work-shift'\nimport { WorkShiftPatch } from './work-shift-type'\n\n@Resolver(WorkShift)\nexport class WorkShiftMutation {\n @Directive('@privilege(category: \"work-shift\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Directive('@transaction')\n @Mutation(returns => [WorkShift], { description: \"To modify multiple WorkShifts' information\" })\n async updateMultipleWorkShift(\n @Arg('patches', type => [WorkShiftPatch]) patches: WorkShiftPatch[],\n @Ctx() context: ResolverContext\n ): Promise<WorkShift[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const workShiftRepo = tx.getRepository(WorkShift)\n\n await workShiftRepo.delete({ domain: { id: domain.id } })\n\n for (let i = 0; i < patches.length; i++) {\n const patch = patches[i]\n\n const result = await workShiftRepo.save({\n ...patch,\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n\n return results\n }\n\n @Directive('@privilege(category: \"work-shift\", privilege: \"mutation\", domainOwnerGranted: true)')\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple workShifts' })\n async deleteWorkShifts(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(WorkShift).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n return true\n }\n}\n"]}
|