@replyke/core 7.0.0-beta.67 → 7.0.0-beta.68
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/reports/useFetchModeratedReports.d.ts +7 -1
- package/dist/cjs/hooks/reports/useFetchModeratedReports.js +2 -2
- package/dist/cjs/hooks/reports/useFetchModeratedReports.js.map +1 -1
- package/dist/esm/hooks/reports/useFetchModeratedReports.d.ts +7 -1
- package/dist/esm/hooks/reports/useFetchModeratedReports.js +2 -2
- package/dist/esm/hooks/reports/useFetchModeratedReports.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
|
|
2
|
+
import { Entity } from "../../interfaces/models/Entity";
|
|
3
|
+
import { Comment } from "../../interfaces/models/Comment";
|
|
4
|
+
import { Space } from "../../interfaces/models/Space";
|
|
2
5
|
interface FetchModeratedReportsParams {
|
|
3
6
|
spaceId?: string;
|
|
4
7
|
targetType?: "Comment" | "Entity";
|
|
8
|
+
status?: "Pending" | "On Hold" | "Escalated" | "Dismissed" | "Actioned";
|
|
5
9
|
sortBy?: "new" | "old";
|
|
6
10
|
page?: number;
|
|
7
11
|
limit?: number;
|
|
@@ -17,6 +21,8 @@ interface Report {
|
|
|
17
21
|
details: string | null;
|
|
18
22
|
status: "Pending" | "On Hold" | "Escalated" | "Dismissed" | "Actioned";
|
|
19
23
|
actionTaken: string | null;
|
|
24
|
+
target: Entity | Comment | null;
|
|
25
|
+
space: Space | null;
|
|
20
26
|
createdAt: Date;
|
|
21
27
|
updatedAt: Date;
|
|
22
28
|
deletedAt: Date | null;
|
|
@@ -44,5 +50,5 @@ interface Report {
|
|
|
44
50
|
* limit: 20
|
|
45
51
|
* });
|
|
46
52
|
*/
|
|
47
|
-
declare function useFetchModeratedReports(): ({ spaceId, targetType, sortBy, page, limit, }: FetchModeratedReportsParams) => Promise<PaginatedResponse<Report>>;
|
|
53
|
+
declare function useFetchModeratedReports(): ({ spaceId, targetType, status, sortBy, page, limit, }: FetchModeratedReportsParams) => Promise<PaginatedResponse<Report>>;
|
|
48
54
|
export default useFetchModeratedReports;
|
|
@@ -71,14 +71,14 @@ function useFetchModeratedReports() {
|
|
|
71
71
|
var axios = (0, useAxiosPrivate_1.default)();
|
|
72
72
|
var fetchModeratedReports = (0, react_1.useCallback)(function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
|
|
73
73
|
var response;
|
|
74
|
-
var spaceId = _b.spaceId, targetType = _b.targetType, sortBy = _b.sortBy, page = _b.page, limit = _b.limit;
|
|
74
|
+
var spaceId = _b.spaceId, targetType = _b.targetType, status = _b.status, sortBy = _b.sortBy, page = _b.page, limit = _b.limit;
|
|
75
75
|
return __generator(this, function (_c) {
|
|
76
76
|
switch (_c.label) {
|
|
77
77
|
case 0:
|
|
78
78
|
if (!projectId) {
|
|
79
79
|
throw new Error("No projectId available.");
|
|
80
80
|
}
|
|
81
|
-
return [4 /*yield*/, axios.get("/".concat(projectId, "/reports/moderated"), { params: { spaceId: spaceId, targetType: targetType, sortBy: sortBy, page: page, limit: limit } })];
|
|
81
|
+
return [4 /*yield*/, axios.get("/".concat(projectId, "/reports/moderated"), { params: { spaceId: spaceId, targetType: targetType, status: status, sortBy: sortBy, page: page, limit: limit } })];
|
|
82
82
|
case 1:
|
|
83
83
|
response = _c.sent();
|
|
84
84
|
return [2 /*return*/, response.data];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFetchModeratedReports.js","sourceRoot":"","sources":["../../../../src/hooks/reports/useFetchModeratedReports.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AACpC,sEAAgD;AAChD,iFAA2D;
|
|
1
|
+
{"version":3,"file":"useFetchModeratedReports.js","sourceRoot":"","sources":["../../../../src/hooks/reports/useFetchModeratedReports.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAoC;AACpC,sEAAgD;AAChD,iFAA2D;AAiC3D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAS,wBAAwB;IAAjC,iBA4BC;IA3BS,IAAA,SAAS,GAAK,IAAA,oBAAU,GAAE,UAAjB,CAAkB;IACnC,IAAM,KAAK,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEhC,IAAM,qBAAqB,GAAG,IAAA,mBAAW,EACvC,gEAAO,EAOuB;;YAN5B,OAAO,aAAA,EACP,UAAU,gBAAA,EACV,MAAM,YAAA,EACN,MAAM,YAAA,EACN,IAAI,UAAA,EACJ,KAAK,WAAA;;;;oBAEL,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAEgB,qBAAM,KAAK,CAAC,GAAG,CAC9B,WAAI,SAAS,uBAAoB,EACjC,EAAE,MAAM,EAAE,EAAE,OAAO,SAAA,EAAE,UAAU,YAAA,EAAE,MAAM,QAAA,EAAE,MAAM,QAAA,EAAE,IAAI,MAAA,EAAE,KAAK,OAAA,EAAE,EAAE,CACjE,EAAA;;oBAHK,QAAQ,GAAG,SAGhB;oBAED,sBAAO,QAAQ,CAAC,IAAI,EAAC;;;SACtB,EACD,CAAC,SAAS,EAAE,KAAK,CAAC,CACnB,CAAC;IAEF,OAAO,qBAAqB,CAAC;AAC/B,CAAC;AAED,kBAAe,wBAAwB,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { PaginatedResponse } from "../../interfaces/IPaginatedResponse";
|
|
2
|
+
import { Entity } from "../../interfaces/models/Entity";
|
|
3
|
+
import { Comment } from "../../interfaces/models/Comment";
|
|
4
|
+
import { Space } from "../../interfaces/models/Space";
|
|
2
5
|
interface FetchModeratedReportsParams {
|
|
3
6
|
spaceId?: string;
|
|
4
7
|
targetType?: "Comment" | "Entity";
|
|
8
|
+
status?: "Pending" | "On Hold" | "Escalated" | "Dismissed" | "Actioned";
|
|
5
9
|
sortBy?: "new" | "old";
|
|
6
10
|
page?: number;
|
|
7
11
|
limit?: number;
|
|
@@ -17,6 +21,8 @@ interface Report {
|
|
|
17
21
|
details: string | null;
|
|
18
22
|
status: "Pending" | "On Hold" | "Escalated" | "Dismissed" | "Actioned";
|
|
19
23
|
actionTaken: string | null;
|
|
24
|
+
target: Entity | Comment | null;
|
|
25
|
+
space: Space | null;
|
|
20
26
|
createdAt: Date;
|
|
21
27
|
updatedAt: Date;
|
|
22
28
|
deletedAt: Date | null;
|
|
@@ -44,5 +50,5 @@ interface Report {
|
|
|
44
50
|
* limit: 20
|
|
45
51
|
* });
|
|
46
52
|
*/
|
|
47
|
-
declare function useFetchModeratedReports(): ({ spaceId, targetType, sortBy, page, limit, }: FetchModeratedReportsParams) => Promise<PaginatedResponse<Report>>;
|
|
53
|
+
declare function useFetchModeratedReports(): ({ spaceId, targetType, status, sortBy, page, limit, }: FetchModeratedReportsParams) => Promise<PaginatedResponse<Report>>;
|
|
48
54
|
export default useFetchModeratedReports;
|
|
@@ -66,14 +66,14 @@ function useFetchModeratedReports() {
|
|
|
66
66
|
var axios = useAxiosPrivate();
|
|
67
67
|
var fetchModeratedReports = useCallback(function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
|
|
68
68
|
var response;
|
|
69
|
-
var spaceId = _b.spaceId, targetType = _b.targetType, sortBy = _b.sortBy, page = _b.page, limit = _b.limit;
|
|
69
|
+
var spaceId = _b.spaceId, targetType = _b.targetType, status = _b.status, sortBy = _b.sortBy, page = _b.page, limit = _b.limit;
|
|
70
70
|
return __generator(this, function (_c) {
|
|
71
71
|
switch (_c.label) {
|
|
72
72
|
case 0:
|
|
73
73
|
if (!projectId) {
|
|
74
74
|
throw new Error("No projectId available.");
|
|
75
75
|
}
|
|
76
|
-
return [4 /*yield*/, axios.get("/".concat(projectId, "/reports/moderated"), { params: { spaceId: spaceId, targetType: targetType, sortBy: sortBy, page: page, limit: limit } })];
|
|
76
|
+
return [4 /*yield*/, axios.get("/".concat(projectId, "/reports/moderated"), { params: { spaceId: spaceId, targetType: targetType, status: status, sortBy: sortBy, page: page, limit: limit } })];
|
|
77
77
|
case 1:
|
|
78
78
|
response = _c.sent();
|
|
79
79
|
return [2 /*return*/, response.data];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFetchModeratedReports.js","sourceRoot":"","sources":["../../../../src/hooks/reports/useFetchModeratedReports.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,eAAe,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"useFetchModeratedReports.js","sourceRoot":"","sources":["../../../../src/hooks/reports/useFetchModeratedReports.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAiC3D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAS,wBAAwB;IAAjC,iBA4BC;IA3BS,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IACnC,IAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAEhC,IAAM,qBAAqB,GAAG,WAAW,CACvC,gEAAO,EAOuB;;YAN5B,OAAO,aAAA,EACP,UAAU,gBAAA,EACV,MAAM,YAAA,EACN,MAAM,YAAA,EACN,IAAI,UAAA,EACJ,KAAK,WAAA;;;;oBAEL,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAEgB,qBAAM,KAAK,CAAC,GAAG,CAC9B,WAAI,SAAS,uBAAoB,EACjC,EAAE,MAAM,EAAE,EAAE,OAAO,SAAA,EAAE,UAAU,YAAA,EAAE,MAAM,QAAA,EAAE,MAAM,QAAA,EAAE,IAAI,MAAA,EAAE,KAAK,OAAA,EAAE,EAAE,CACjE,EAAA;;oBAHK,QAAQ,GAAG,SAGhB;oBAED,sBAAO,QAAQ,CAAC,IAAI,EAAC;;;SACtB,EACD,CAAC,SAAS,EAAE,KAAK,CAAC,CACnB,CAAC;IAEF,OAAO,qBAAqB,CAAC;AAC/B,CAAC;AAED,eAAe,wBAAwB,CAAC"}
|