Skip to content

Commit

Permalink
fix(#1): Add logo
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenix741 committed Oct 16, 2018
1 parent 5c40131 commit 299d684
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions server/controllers/line.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ export const resolvers = {
* @returns {Object} The filtered object.
*/
function filterLine (line) {
return _.pick(line, '_id', 'user', 'type', 'label', 'group', 'encryption', 'updatedAt', '_rev')
return _.pick(line, '_id', 'user', 'type', 'label', 'group', 'logo', 'encryption', 'updatedAt', '_rev')
}

function sanitizeInput (input) {
const data = _.pick(input, '_id', 'user', 'type', 'label', 'group', 'encryption', '_rev')
const data = _.pick(input, '_id', 'user', 'type', 'label', 'group', 'logo', 'encryption', '_rev')

const validationError = new Error()
validationError.status = 400
Expand Down
4 changes: 4 additions & 0 deletions server/graphql/line.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ type WalletLine {
label: String!,
# Group of the wallet line
group: String,
# Logo of the line
logo: String,
# Encrypted content of the line (encrypted client side)
encryption: EncryptedWalletLine!,
# Owner of the list
Expand All @@ -44,6 +46,8 @@ input WalletLineInput {
label: String!,
# Group of the wallet line
group: String,
# Logo of the line
logo: String,
# Encrypted content of the line (encrypted client side)
encryption: EncryptedWalletLineInput!,
# Revision (modification count) of the line, used to ensure modification of the last line
Expand Down
3 changes: 2 additions & 1 deletion server/models/line.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { processMongoException, NotFoundError } from './exception'
* label: {type: String},
* type: {type: String},
* group: {type: String},
* logo: {type: String},
* encryption: {type: encrypted Object}
* updatedAt: {type: Date}
* _rev: {type: Number}
Expand Down Expand Up @@ -39,7 +40,7 @@ export async function getLine (id, _rev) {
}

export async function saveLine (line) {
const cleanLine = _.omit(line, '_rev')
const cleanLine = _.omit(line, '_rev', '_id')
const revision = line._rev
const query = { _id: new mongodb.ObjectID(line._id) }
if (revision) {
Expand Down

0 comments on commit 299d684

Please sign in to comment.