Skip to content

Commit 35d618d

Browse files
committed
enhancement(Expense): protect invoice reference ID
1 parent aecb75d commit 35d618d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

server/graphql/v2/object/Expense.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ export const GraphQLExpense = new GraphQLObjectType<ExpenseModel, Express.Reques
129129
reference: {
130130
type: GraphQLString,
131131
description: 'User-provided reference number or any other identifier that references the invoice',
132+
async resolve(expense, _, req) {
133+
if (await ExpenseLib.canSeeExpenseInvoiceInfo(req, expense)) {
134+
return expense.reference;
135+
}
136+
},
132137
},
133138
amount: {
134139
type: new GraphQLNonNull(GraphQLInt),

0 commit comments

Comments
 (0)