返回提交历史
Modified
src/controllers/api/inboxController.ts
+2
-2
Modified
src/models/inboxModel.ts
+5
-1
XFEstudio/XFESpaceNinjaServer
feat: add attVisualOnly to inbox messages (#1499)
In case we'll need it... Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1499 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
a2f14697
代码差异
2 个文件
+7
-3
@@ -34,8 +34,8 @@ export const inboxController: RequestHandler = async (req, res) => {
34
34
message.r = true;
35
35
await message.save();
36
36
37
const attachmentItems = message.att;
38
const attachmentCountedItems = message.countedAtt;
37
const attachmentItems = message.attVisualOnly ? undefined : message.att;
38
const attachmentCountedItems = message.attVisualOnly ? undefined : message.countedAtt;
39
39
40
40
if (!attachmentItems && !attachmentCountedItems && !message.gifts) {
41
41
res.status(200).end();
@@ -4,7 +4,8 @@ import { typeCountSchema } from "@/src/models/inventoryModels/inventoryModel";
4
4
import { IMongoDate, IOid } from "@/src/types/commonTypes";
5
5
import { ITypeCount } from "@/src/types/inventoryTypes/inventoryTypes";
6
6
7
export interface IMessageClient extends Omit<IMessageDatabase, "_id" | "date" | "startDate" | "endDate" | "ownerId"> {
7
export interface IMessageClient
8
extends Omit<IMessageDatabase, "_id" | "date" | "startDate" | "endDate" | "ownerId" | "attVisualOnly"> {
8
9
_id?: IOid;
9
10
date: IMongoDate;
10
11
startDate?: IMongoDate;
@@ -29,6 +30,7 @@ export interface IMessage {
29
30
endDate?: Date;
30
31
att?: string[];
31
32
countedAtt?: ITypeCount[];
33
attVisualOnly?: boolean;
32
34
transmission?: string;
33
35
arg?: Arg[];
34
36
gifts?: IGift[];
@@ -108,6 +110,7 @@ const messageSchema = new Schema<IMessageDatabase>(
108
110
att: { type: [String], default: undefined },
109
111
gifts: { type: [giftSchema], default: undefined },
110
112
countedAtt: { type: [typeCountSchema], default: undefined },
113
attVisualOnly: Boolean,
111
114
transmission: String,
112
115
arg: {
113
116
type: [
@@ -141,6 +144,7 @@ messageSchema.set("toJSON", {
141
144
142
145
delete returnedObject._id;
143
146
delete returnedObject.__v;
147
delete returnedObject.attVisualOnly;
144
148
145
149
messageClient.date = toMongoDate(messageDatabase.date);
146
150