From 9c5f3f1946162fb52b0f28b26d24b4dc3c411590 Mon Sep 17 00:00:00 2001 From: "Wesley F. Young" Date: Sat, 31 Aug 2024 13:37:22 +0800 Subject: [PATCH] chore: clean code for collection.ts --- src/core/apis/collection.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/core/apis/collection.ts b/src/core/apis/collection.ts index a83ad38b..262a8c6a 100644 --- a/src/core/apis/collection.ts +++ b/src/core/apis/collection.ts @@ -10,7 +10,7 @@ export class NTQQCollectionApi { } async createCollection(authorUin: string, authorUid: string, authorName: string, brief: string, rawData: string) { - const param = { + return this.context.session.getCollectionService().createNewCollectionItem({ commInfo: { bid: 1, category: 2, @@ -43,12 +43,11 @@ export class NTQQCollectionApi { fileList: [], }, need_share_url: false, - }; - return this.context.session.getCollectionService().createNewCollectionItem(param); + }); } async getAllCollection(category: number = 0, count: number = 50) { - const param = { + return this.context.session.getCollectionService().getCollectionItemList({ category: category, groupId: -1, forceSync: true, @@ -56,7 +55,6 @@ export class NTQQCollectionApi { timeStamp: '0', count: count, searchDown: true, - }; - return this.context.session.getCollectionService().getCollectionItemList(param); + }); } }