mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-16 02:36:19 +00:00
tag
This commit is contained in:
15
package-lock.json
generated
15
package-lock.json
generated
@ -6896,21 +6896,6 @@
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/fsevents": {
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
||||
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/function-bind": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
||||
|
@ -5,11 +5,7 @@ import {
|
||||
SpaceModelRepository,
|
||||
} from '@app/common/modules/space-model';
|
||||
import { HttpException, HttpStatus, Injectable } from '@nestjs/common';
|
||||
import {
|
||||
CreateSpaceModelDto,
|
||||
CreateSubspaceModelDto,
|
||||
UpdateSpaceModelDto,
|
||||
} from '../dtos';
|
||||
import { CreateSpaceModelDto, UpdateSpaceModelDto } from '../dtos';
|
||||
import { ProjectParam } from 'src/community/dtos';
|
||||
import { SuccessResponseDto } from '@app/common/dto/success.response.dto';
|
||||
import { SubSpaceModelService } from './subspace/subspace-model.service';
|
||||
@ -58,7 +54,7 @@ export class SpaceModelService {
|
||||
const queryRunner = this.dataSource.createQueryRunner();
|
||||
await queryRunner.connect();
|
||||
await queryRunner.startTransaction();
|
||||
|
||||
console.log("c");
|
||||
try {
|
||||
const project = await this.validateProject(params.projectUuid);
|
||||
|
||||
@ -106,12 +102,13 @@ export class SpaceModelService {
|
||||
statusCode: HttpStatus.CREATED,
|
||||
});
|
||||
} catch (error) {
|
||||
console.log("jj");
|
||||
await queryRunner.rollbackTransaction();
|
||||
|
||||
const errorMessage =
|
||||
error instanceof HttpException
|
||||
? error.message
|
||||
: 'An unexpected error occurred';
|
||||
: `An unexpected error occurred ${error.message}`;
|
||||
const statusCode =
|
||||
error instanceof HttpException
|
||||
? error.getStatus()
|
||||
|
@ -53,19 +53,16 @@ export class SubSpaceModelService {
|
||||
subspaceEntities.push(subspaceModel);
|
||||
}
|
||||
|
||||
// Save all subspaces in bulk
|
||||
const savedSubspaces = await queryRunner.manager.save(subspaceEntities);
|
||||
|
||||
for (const [index, dto] of dtos.entries()) {
|
||||
const subspaceModel = savedSubspaces[index];
|
||||
|
||||
// Process tags for this subspace
|
||||
const processedTags = await this.tagService.processTags(
|
||||
dto.tags,
|
||||
spaceModel.project.uuid,
|
||||
);
|
||||
|
||||
// Create Product Allocations for Subspace Model
|
||||
await this.createSubspaceProductAllocations(subspaceModel, processedTags);
|
||||
}
|
||||
return savedSubspaces;
|
||||
|
Reference in New Issue
Block a user