Support multiple expenses in one reimburesement
This commit is contained in:
@@ -20,6 +20,11 @@ class Expense {
|
||||
* @public
|
||||
*/
|
||||
serialize () {
|
||||
// Write it pretty to ipfs
|
||||
return JSON.stringify(this.data, null, 2);
|
||||
}
|
||||
|
||||
get data () {
|
||||
let {
|
||||
title,
|
||||
description,
|
||||
@@ -47,8 +52,7 @@ class Expense {
|
||||
data['url'] = url;
|
||||
}
|
||||
|
||||
// Write it pretty to ipfs
|
||||
return JSON.stringify(data, null, 2);
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,7 +62,6 @@ class Expense {
|
||||
*/
|
||||
validate () {
|
||||
const serialized = JSON.parse(this.serialize());
|
||||
console.log(schemas['expense']);
|
||||
const valid = validator.validate(serialized, schemas['expense']);
|
||||
return valid ? Promise.resolve() : Promise.reject(validator.error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user