backend/app/FakeResponse.js
garrettmills 55a22a4f4c
All checks were successful
continuous-integration/drone/push Build is passing
Start /api/v1/offline/sync endpoint
2020-10-28 22:55:04 -05:00

53 lines
996 B
JavaScript

const { Injectable } = require('flitter-di')
class FakeResponse extends Injectable {
_message = 'OK'
_status = 200
_api_data = undefined
_send_data = undefined
_view = undefined
_view_data = undefined
status(set = undefined) {
if ( set ) {
this._status = set
return this
} else {
return this._status
}
}
message(set = undefined) {
if ( set ) {
this._message = set
return this
} else {
return this._message
}
}
api(data = {}) {
this._api_data = data
return this
}
send(data = '') {
this._send_data = ''
return this
}
view(name, data = {}) {
this._view = name
this._view_data = data
return this
}
page(name, data = {}) {
this._view = name
this._view_data = data
return this
}
}
module.exports = exports = FakeResponse