mirror of https://github.com/halo-dev/halo-admin
chore: remove unused imports
parent
9198be086a
commit
f3d5bf7a3f
|
@ -15,14 +15,9 @@ import {
|
||||||
} from "@halo-dev/components";
|
} from "@halo-dev/components";
|
||||||
import CommentListItem from "./components/CommentListItem.vue";
|
import CommentListItem from "./components/CommentListItem.vue";
|
||||||
import UserDropdownSelector from "@/components/dropdown-selector/UserDropdownSelector.vue";
|
import UserDropdownSelector from "@/components/dropdown-selector/UserDropdownSelector.vue";
|
||||||
import type {
|
import type { ListedComment, User } from "@halo-dev/api-client";
|
||||||
ListedComment,
|
import { computed, ref, watch } from "vue";
|
||||||
ListedCommentList,
|
|
||||||
User,
|
|
||||||
} from "@halo-dev/api-client";
|
|
||||||
import { computed, onMounted, ref, watch } from "vue";
|
|
||||||
import { apiClient } from "@/utils/api-client";
|
import { apiClient } from "@/utils/api-client";
|
||||||
import { onBeforeRouteLeave } from "vue-router";
|
|
||||||
import FilterTag from "@/components/filter/FilterTag.vue";
|
import FilterTag from "@/components/filter/FilterTag.vue";
|
||||||
import FilterCleanButton from "@/components/filter/FilterCleanButton.vue";
|
import FilterCleanButton from "@/components/filter/FilterCleanButton.vue";
|
||||||
import { getNode } from "@formkit/core";
|
import { getNode } from "@formkit/core";
|
||||||
|
@ -247,15 +242,20 @@ const handleApproveInBatch = async () => {
|
||||||
) && !comment.comment.spec.approved
|
) && !comment.comment.spec.approved
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const promises = commentsToUpdate?.map((comment) => {
|
const promises = commentsToUpdate?.map((comment) => {
|
||||||
const commentToUpdate = comment.comment;
|
|
||||||
commentToUpdate.spec.approved = true;
|
|
||||||
// TODO: 暂时由前端设置发布时间。see https://github.com/halo-dev/halo/pull/2746
|
|
||||||
commentToUpdate.spec.approvedTime = new Date().toISOString();
|
|
||||||
return apiClient.extension.comment.updatecontentHaloRunV1alpha1Comment(
|
return apiClient.extension.comment.updatecontentHaloRunV1alpha1Comment(
|
||||||
{
|
{
|
||||||
name: commentToUpdate.metadata.name,
|
name: comment.comment.metadata.name,
|
||||||
comment: commentToUpdate,
|
comment: {
|
||||||
|
...comment.comment,
|
||||||
|
spec: {
|
||||||
|
...comment.comment.spec,
|
||||||
|
approved: true,
|
||||||
|
// TODO: 暂时由前端设置发布时间。see https://github.com/halo-dev/halo/pull/2746
|
||||||
|
approvedTime: new Date().toISOString(),
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
@ -84,13 +84,17 @@ const handleApproveReplyInBatch = async () => {
|
||||||
return !reply.reply.spec.approved;
|
return !reply.reply.spec.approved;
|
||||||
});
|
});
|
||||||
const promises = repliesToUpdate?.map((reply) => {
|
const promises = repliesToUpdate?.map((reply) => {
|
||||||
const replyToUpdate = reply.reply;
|
|
||||||
replyToUpdate.spec.approved = true;
|
|
||||||
// TODO: 暂时由前端设置发布时间。see https://github.com/halo-dev/halo/pull/2746
|
|
||||||
replyToUpdate.spec.approvedTime = new Date().toISOString();
|
|
||||||
return apiClient.extension.reply.updatecontentHaloRunV1alpha1Reply({
|
return apiClient.extension.reply.updatecontentHaloRunV1alpha1Reply({
|
||||||
name: replyToUpdate.metadata.name,
|
name: reply.reply.metadata.name,
|
||||||
reply: replyToUpdate,
|
reply: {
|
||||||
|
...reply.reply,
|
||||||
|
spec: {
|
||||||
|
...reply.reply.spec,
|
||||||
|
approved: true,
|
||||||
|
// TODO: 暂时由前端设置发布时间。see https://github.com/halo-dev/halo/pull/2746
|
||||||
|
approvedTime: new Date().toISOString(),
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
await Promise.all(promises || []);
|
await Promise.all(promises || []);
|
||||||
|
@ -163,12 +167,14 @@ const handleToggleShowReplies = async () => {
|
||||||
showReplies.value = !showReplies.value;
|
showReplies.value = !showReplies.value;
|
||||||
if (showReplies.value) {
|
if (showReplies.value) {
|
||||||
// update last read time
|
// update last read time
|
||||||
const commentToUpdate = cloneDeep(props.comment.comment);
|
if (props.comment.comment.status?.unreadReplyCount) {
|
||||||
commentToUpdate.spec.lastReadTime = new Date().toISOString();
|
const commentToUpdate = cloneDeep(props.comment.comment);
|
||||||
await apiClient.extension.comment.updatecontentHaloRunV1alpha1Comment({
|
commentToUpdate.spec.lastReadTime = new Date().toISOString();
|
||||||
name: commentToUpdate.metadata.name,
|
await apiClient.extension.comment.updatecontentHaloRunV1alpha1Comment({
|
||||||
comment: commentToUpdate,
|
name: commentToUpdate.metadata.name,
|
||||||
});
|
comment: commentToUpdate,
|
||||||
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
emit("reload");
|
emit("reload");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue