@replyke/core 6.0.5 → 6.0.6
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/cjs/hooks/comments/useFetchManyComments.d.ts +1 -0
- package/dist/cjs/hooks/comments/useFetchManyComments.js +18 -11
- package/dist/cjs/hooks/comments/useFetchManyComments.js.map +1 -1
- package/dist/esm/hooks/comments/useFetchManyComments.d.ts +1 -0
- package/dist/esm/hooks/comments/useFetchManyComments.js +18 -11
- package/dist/esm/hooks/comments/useFetchManyComments.js.map +1 -1
- package/package.json +1 -1
|
@@ -46,11 +46,11 @@ function useFetchManyComments() {
|
|
|
46
46
|
var _this = this;
|
|
47
47
|
var projectId = (0, useProject_1.default)().projectId;
|
|
48
48
|
var fetchComments = (0, react_1.useCallback)(function (props) { return __awaiter(_this, void 0, void 0, function () {
|
|
49
|
-
var entityId, userId, parentId, sortBy, page, limit, includeEntity, response;
|
|
49
|
+
var entityId, userId, parentId, sortBy, page, limit, includeEntity, sourceId, params, response;
|
|
50
50
|
return __generator(this, function (_a) {
|
|
51
51
|
switch (_a.label) {
|
|
52
52
|
case 0:
|
|
53
|
-
entityId = props.entityId, userId = props.userId, parentId = props.parentId, sortBy = props.sortBy, page = props.page, limit = props.limit, includeEntity = props.includeEntity;
|
|
53
|
+
entityId = props.entityId, userId = props.userId, parentId = props.parentId, sortBy = props.sortBy, page = props.page, limit = props.limit, includeEntity = props.includeEntity, sourceId = props.sourceId;
|
|
54
54
|
if (page === 0) {
|
|
55
55
|
throw new Error("Can't fetch comments with page 0");
|
|
56
56
|
}
|
|
@@ -63,16 +63,23 @@ function useFetchManyComments() {
|
|
|
63
63
|
if (!projectId) {
|
|
64
64
|
throw new Error("No project specified");
|
|
65
65
|
}
|
|
66
|
+
params = {
|
|
67
|
+
sortBy: sortBy,
|
|
68
|
+
page: page,
|
|
69
|
+
limit: limit,
|
|
70
|
+
};
|
|
71
|
+
if (entityId)
|
|
72
|
+
params.entityId = entityId;
|
|
73
|
+
if (userId)
|
|
74
|
+
params.userId = userId;
|
|
75
|
+
if (parentId)
|
|
76
|
+
params.parentId = parentId;
|
|
77
|
+
if (includeEntity)
|
|
78
|
+
params.includeEntity = includeEntity;
|
|
79
|
+
if (sourceId)
|
|
80
|
+
params.sourceId = sourceId;
|
|
66
81
|
return [4 /*yield*/, axios_1.default.get("/".concat(projectId, "/comments"), {
|
|
67
|
-
params:
|
|
68
|
-
entityId: entityId,
|
|
69
|
-
userId: userId,
|
|
70
|
-
parentId: parentId,
|
|
71
|
-
sortBy: sortBy,
|
|
72
|
-
page: page,
|
|
73
|
-
limit: limit,
|
|
74
|
-
includeEntity: includeEntity,
|
|
75
|
-
},
|
|
82
|
+
params: params,
|
|
76
83
|
})];
|
|
77
84
|
case 1:
|
|
78
85
|
response = _a.sent();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFetchManyComments.js","sourceRoot":"","sources":["../../../../src/hooks/comments/useFetchManyComments.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AAGpC,sEAAgD;AAChD,6DAAuC;AAEvC,SAAS,oBAAoB;IAA7B,
|
|
1
|
+
{"version":3,"file":"useFetchManyComments.js","sourceRoot":"","sources":["../../../../src/hooks/comments/useFetchManyComments.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AAGpC,sEAAgD;AAChD,6DAAuC;AAEvC,SAAS,oBAAoB;IAA7B,iBA8DC;IA7DS,IAAA,SAAS,GAAK,IAAA,oBAAU,GAAE,UAAjB,CAAkB;IAEnC,IAAM,aAAa,GAAG,IAAA,mBAAW,EAC/B,UAAO,KASN;;;;;oBAEG,QAAQ,GAQN,KAAK,SARC,EACR,MAAM,GAOJ,KAAK,OAPD,EACN,QAAQ,GAMN,KAAK,SANC,EACR,MAAM,GAKJ,KAAK,OALD,EACN,IA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 +41,11 @@ function useFetchManyComments() {
|
|
|
41
41
|
var _this = this;
|
|
42
42
|
var projectId = useProject().projectId;
|
|
43
43
|
var fetchComments = useCallback(function (props) { return __awaiter(_this, void 0, void 0, function () {
|
|
44
|
-
var entityId, userId, parentId, sortBy, page, limit, includeEntity, response;
|
|
44
|
+
var entityId, userId, parentId, sortBy, page, limit, includeEntity, sourceId, params, response;
|
|
45
45
|
return __generator(this, function (_a) {
|
|
46
46
|
switch (_a.label) {
|
|
47
47
|
case 0:
|
|
48
|
-
entityId = props.entityId, userId = props.userId, parentId = props.parentId, sortBy = props.sortBy, page = props.page, limit = props.limit, includeEntity = props.includeEntity;
|
|
48
|
+
entityId = props.entityId, userId = props.userId, parentId = props.parentId, sortBy = props.sortBy, page = props.page, limit = props.limit, includeEntity = props.includeEntity, sourceId = props.sourceId;
|
|
49
49
|
if (page === 0) {
|
|
50
50
|
throw new Error("Can't fetch comments with page 0");
|
|
51
51
|
}
|
|
@@ -58,16 +58,23 @@ function useFetchManyComments() {
|
|
|
58
58
|
if (!projectId) {
|
|
59
59
|
throw new Error("No project specified");
|
|
60
60
|
}
|
|
61
|
+
params = {
|
|
62
|
+
sortBy: sortBy,
|
|
63
|
+
page: page,
|
|
64
|
+
limit: limit,
|
|
65
|
+
};
|
|
66
|
+
if (entityId)
|
|
67
|
+
params.entityId = entityId;
|
|
68
|
+
if (userId)
|
|
69
|
+
params.userId = userId;
|
|
70
|
+
if (parentId)
|
|
71
|
+
params.parentId = parentId;
|
|
72
|
+
if (includeEntity)
|
|
73
|
+
params.includeEntity = includeEntity;
|
|
74
|
+
if (sourceId)
|
|
75
|
+
params.sourceId = sourceId;
|
|
61
76
|
return [4 /*yield*/, axios.get("/".concat(projectId, "/comments"), {
|
|
62
|
-
params:
|
|
63
|
-
entityId: entityId,
|
|
64
|
-
userId: userId,
|
|
65
|
-
parentId: parentId,
|
|
66
|
-
sortBy: sortBy,
|
|
67
|
-
page: page,
|
|
68
|
-
limit: limit,
|
|
69
|
-
includeEntity: includeEntity,
|
|
70
|
-
},
|
|
77
|
+
params: params,
|
|
71
78
|
})];
|
|
72
79
|
case 1:
|
|
73
80
|
response = _a.sent();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFetchManyComments.js","sourceRoot":"","sources":["../../../../src/hooks/comments/useFetchManyComments.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAGpC,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,KAAK,MAAM,oBAAoB,CAAC;AAEvC,SAAS,oBAAoB;IAA7B,
|
|
1
|
+
{"version":3,"file":"useFetchManyComments.js","sourceRoot":"","sources":["../../../../src/hooks/comments/useFetchManyComments.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAGpC,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,KAAK,MAAM,oBAAoB,CAAC;AAEvC,SAAS,oBAAoB;IAA7B,iBA8DC;IA7DS,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAEnC,IAAM,aAAa,GAAG,WAAW,CAC/B,UAAO,KASN;;;;;oBAEG,QAAQ,GAQN,KAAK,SARC,EACR,MAAM,GAOJ,KAAK,OAPD,EACN,QAAQ,GAMN,KAAK,SANC,EACR,MAAM,GAKJ,KAAK,OALD,EACN,IAAI,GAIF,KAAK,KAJH,EACJ,KAAK,GAGH,KAAK,MAHF,EACL,aAAa,GAEX,KAAK,cAFM,EACb,QAAQ,GACN,KAAK,SADC,CACA;oBAEV,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;oBACtD,CAAC;oBAED,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;wBACh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