fix:
修复邮件
This commit is contained in:
parent
8c0487bd58
commit
f8298f08e9
@ -3,9 +3,9 @@ import { EmailFun } from '../../public/email';
|
|||||||
import { ReqAllRemove, ResAllRemove } from "../../shared/protocols/email/PtlAllRemove";
|
import { ReqAllRemove, ResAllRemove } from "../../shared/protocols/email/PtlAllRemove";
|
||||||
|
|
||||||
export default async function (call: ApiCall<ReqAllRemove, ResAllRemove>) {
|
export default async function (call: ApiCall<ReqAllRemove, ResAllRemove>) {
|
||||||
// 筛选出没有奖励已读邮件和已经领取过奖励的邮件
|
// 邮件已读 并且 (没有奖励 或者 (有奖励 并且 领取了))
|
||||||
let emailList = (await EmailFun.getAllEmail(call.uid, true)).filter(email => (
|
let emailList = (await EmailFun.getAllEmail(call.uid, true)).filter(email => (
|
||||||
(email.emailRead && email.prizeData?.prize.length <= 0) || email.prizeData.isGet
|
email.emailRead && (!email.prizeData || (email.prizeData?.prize.length > 0 && email.prizeData?.isGet))
|
||||||
));
|
));
|
||||||
|
|
||||||
if (emailList.length < 1) return call.error(globalThis.lng.email_2);
|
if (emailList.length < 1) return call.error(globalThis.lng.email_2);
|
||||||
|
Loading…
Reference in New Issue
Block a user