From dfa07a4c5a009847b4bbd8c375e51c6c4e2e496f Mon Sep 17 00:00:00 2001 From: KUN1007 Date: Sat, 2 Dec 2023 15:17:19 +0800 Subject: [PATCH] BUG fix: NaN --- src/api/topic/reply.ts | 4 ++-- src/store/modules/topic/reply.ts | 4 ++-- src/store/temp/topic/reply.ts | 4 ++-- src/views/topic/KUNGalgameTopicPage.vue | 5 +---- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/api/topic/reply.ts b/src/api/topic/reply.ts index 8fab2fbe..05247987 100644 --- a/src/api/topic/reply.ts +++ b/src/api/topic/reply.ts @@ -4,7 +4,7 @@ import objectToQueryParams from '@/utils/objectToQueryParams' import * as Reply from './types/reply' // Get topic replies by tid -export async function getRepliesByPidApi( +export async function getRepliesByTidApi( request: Reply.TopicReplyRequestData ): Promise { const queryParams = objectToQueryParams(request, 'tid') @@ -16,7 +16,7 @@ export async function getRepliesByPidApi( } // Create a reply by tid -export async function postReplyByPidApi( +export async function postReplyByTidApi( request: Reply.TopicCreateReplyRequestData ): Promise { const url = `/topics/${request.tid}/reply` diff --git a/src/store/modules/topic/reply.ts b/src/store/modules/topic/reply.ts index ed5c73fb..f519bff1 100644 --- a/src/store/modules/topic/reply.ts +++ b/src/store/modules/topic/reply.ts @@ -1,6 +1,6 @@ import { defineStore } from 'pinia' -import { postReplyByPidApi } from '@/api' +import { postReplyByTidApi } from '@/api' import type { TopicCreateReplyRequestData, @@ -48,7 +48,7 @@ export const usePersistKUNGalgameReplyStore = defineStore({ return } - return await postReplyByPidApi(requestData) + return await postReplyByTidApi(requestData) }, // Reset reply draft to its original value, used for the reply publish button diff --git a/src/store/temp/topic/reply.ts b/src/store/temp/topic/reply.ts index 98c4b202..c584848f 100644 --- a/src/store/temp/topic/reply.ts +++ b/src/store/temp/topic/reply.ts @@ -1,7 +1,7 @@ import { defineStore } from 'pinia' import { - getRepliesByPidApi, + getRepliesByTidApi, updateReplyUpvoteApi, updateReplyLikeApi, updateReplyDislikeApi, @@ -91,7 +91,7 @@ export const useTempReplyStore = defineStore({ sortField: this.replyRequest.sortField || 'floor', sortOrder: this.replyRequest.sortOrder || 'desc', } - return await getRepliesByPidApi(requestData) + return await getRepliesByTidApi(requestData) }, // Upvote a reply diff --git a/src/views/topic/KUNGalgameTopicPage.vue b/src/views/topic/KUNGalgameTopicPage.vue index ffdcfd15..bc2fb637 100644 --- a/src/views/topic/KUNGalgameTopicPage.vue +++ b/src/views/topic/KUNGalgameTopicPage.vue @@ -1,4 +1,3 @@ -