@serene-dev/la-nest-library 0.0.72 → 0.0.73
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/libs/la-library/src/controllers/file.controller.js +3 -3
- package/dist/libs/la-library/src/dtos/base.dto.d.ts +1 -1
- package/dist/libs/la-library/src/dtos/base.dto.js +1 -1
- package/dist/libs/la-library/src/dtos/search.dto.d.ts +1 -1
- package/dist/libs/la-library/src/dtos/search.dto.js +1 -1
- package/dist/libs/la-library/src/entities/base.entity.d.ts +1 -1
- package/dist/libs/la-library/src/services/file.service.js +3 -3
- package/dist/libs/la-library/src/services/likes.service.js +1 -1
- package/dist/libs/la-library/src/services/search.service.js +1 -1
- package/package.json +1 -1
|
@@ -42,14 +42,14 @@ let FileController = class FileController {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
async like(params, auth) {
|
|
45
|
-
params.
|
|
45
|
+
params.creatorId = auth?.id;
|
|
46
46
|
return utility_service_1.UtilityClass.handleSuccess({
|
|
47
47
|
data: await this.fileService.likeFile(params),
|
|
48
48
|
message: `${subject} like successfully`,
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
async dislike(params, auth) {
|
|
52
|
-
params.
|
|
52
|
+
params.creatorId = auth?.id;
|
|
53
53
|
return utility_service_1.UtilityClass.handleSuccess({
|
|
54
54
|
data: await this.fileService.dislikeFile(params),
|
|
55
55
|
message: `${subject} disliked successfully`,
|
|
@@ -59,7 +59,7 @@ let FileController = class FileController {
|
|
|
59
59
|
return this.fileService.search(query);
|
|
60
60
|
}
|
|
61
61
|
async unlike(params, auth) {
|
|
62
|
-
params.
|
|
62
|
+
params.creatorId = auth?.id;
|
|
63
63
|
return utility_service_1.UtilityClass.handleSuccess({
|
|
64
64
|
data: await this.fileService.unlikeFile(params),
|
|
65
65
|
message: `${subject} unliked successfully`,
|
|
@@ -25,7 +25,7 @@ __decorate([
|
|
|
25
25
|
(0, class_validator_1.IsOptional)(),
|
|
26
26
|
(0, swagger_1.ApiProperty)({ required: false }),
|
|
27
27
|
__metadata("design:type", String)
|
|
28
|
-
], BaseDto.prototype, "
|
|
28
|
+
], BaseDto.prototype, "creatorId", void 0);
|
|
29
29
|
__decorate([
|
|
30
30
|
(0, class_validator_1.IsUUID)(),
|
|
31
31
|
(0, class_validator_1.IsOptional)(),
|
|
@@ -2,7 +2,7 @@ import { BaseDto } from './base.dto';
|
|
|
2
2
|
import { ESortOrder } from '../enums/search.enum';
|
|
3
3
|
export declare class SearchQueryDto extends BaseDto {
|
|
4
4
|
createdAt?: string;
|
|
5
|
-
|
|
5
|
+
creatorId?: string;
|
|
6
6
|
createdFrom?: string;
|
|
7
7
|
createdTo?: string;
|
|
8
8
|
orgID?: string;
|
|
@@ -27,7 +27,7 @@ __decorate([
|
|
|
27
27
|
(0, class_validator_1.IsOptional)(),
|
|
28
28
|
(0, swagger_1.ApiProperty)({ required: false }),
|
|
29
29
|
__metadata("design:type", String)
|
|
30
|
-
], SearchQueryDto.prototype, "
|
|
30
|
+
], SearchQueryDto.prototype, "creatorId", void 0);
|
|
31
31
|
__decorate([
|
|
32
32
|
(0, class_validator_1.IsDateString)(),
|
|
33
33
|
(0, class_validator_1.IsOptional)(),
|
|
@@ -60,7 +60,7 @@ let FileService = FileService_1 = class FileService {
|
|
|
60
60
|
const res = await this.likesService.likeFile({
|
|
61
61
|
refID: params.fileID,
|
|
62
62
|
refCat: refCat,
|
|
63
|
-
createdBy: params.
|
|
63
|
+
createdBy: params.creatorId,
|
|
64
64
|
});
|
|
65
65
|
return await this.updateLikesDislikes(params.fileID, res);
|
|
66
66
|
}
|
|
@@ -68,7 +68,7 @@ let FileService = FileService_1 = class FileService {
|
|
|
68
68
|
const res = await this.likesService.dislikeFile({
|
|
69
69
|
refID: params.fileID,
|
|
70
70
|
refCat: refCat,
|
|
71
|
-
createdBy: params.
|
|
71
|
+
createdBy: params.creatorId,
|
|
72
72
|
});
|
|
73
73
|
return await this.updateLikesDislikes(params.fileID, res);
|
|
74
74
|
}
|
|
@@ -76,7 +76,7 @@ let FileService = FileService_1 = class FileService {
|
|
|
76
76
|
const res = await this.likesService.unlikeFile({
|
|
77
77
|
refID: params.fileID,
|
|
78
78
|
refCat: refCat,
|
|
79
|
-
createdBy: params.
|
|
79
|
+
createdBy: params.creatorId,
|
|
80
80
|
});
|
|
81
81
|
return await this.updateLikesDislikes(params.fileID, res);
|
|
82
82
|
}
|
|
@@ -29,7 +29,7 @@ let LikesService = class LikesService {
|
|
|
29
29
|
}
|
|
30
30
|
else {
|
|
31
31
|
const existingLikes = await this.likesRepository.find({
|
|
32
|
-
where: {
|
|
32
|
+
where: { creatorId: params.createdBy, refCat: params.refCat },
|
|
33
33
|
});
|
|
34
34
|
if (existingLikes.length === 0)
|
|
35
35
|
await this.likesRepository.save({ ...params, liked: isLike });
|