Skip to content

Commit

Permalink
Expose user's opt-out of ads setting
Browse files Browse the repository at this point in the history
  • Loading branch information
stripedpajamas committed Jul 11, 2020
1 parent 0e3a2ab commit 65f7abf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 3 additions & 2 deletions api/user/create-donation.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const S = require('fluent-schema')
const { UserCreateDonation } = require('../../types/User')
const { Base200Response } = require('../../common/reply')
const { Base200WithData } = require('../../common/reply')

module.exports = {
body: UserCreateDonation,
response: {
200: Base200Response
200: Base200WithData('optOutOfAds', S.boolean())
}
}
5 changes: 3 additions & 2 deletions api/user/update-donation.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const S = require('fluent-schema')
const { UserUpdateDonation } = require('../../types/User')
const { Base200Response } = require('../../common/reply')
const { Base200WithData } = require('../../common/reply')

module.exports = {
body: UserUpdateDonation,
response: {
200: Base200Response
200: Base200WithData('optOutOfAds', S.boolean())
}
}
4 changes: 4 additions & 0 deletions types/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ const UserPublic = S.object()
'billingInfo',
UserBillingInfoPublic
)
.prop(
'optOutOfAds',
S.boolean().description('Whether or not the user has opted out of seeing ads (by donating).')
)

const UserPrivate = S.object()
.extend(UserPublic)
Expand Down

0 comments on commit 65f7abf

Please sign in to comment.