changes2
This commit is contained in:
parent
f8df3f1f3d
commit
b77ecc2c06
|
@ -1,8 +1,8 @@
|
|||
const UserError = require('vn-loopback/util/user-error');
|
||||
|
||||
module.exports = Self => {
|
||||
Self.remoteMethodCtx('absences', {
|
||||
description: 'Returns an array of absences from an specified worker',
|
||||
Self.remoteMethodCtx('holidays', {
|
||||
description: 'Returns data - Change me',
|
||||
accepts: [{
|
||||
arg: 'businessFk',
|
||||
type: 'number',
|
||||
|
@ -14,23 +14,16 @@ module.exports = Self => {
|
|||
required: true,
|
||||
}],
|
||||
returns: [{
|
||||
arg: 'calendar'
|
||||
},
|
||||
{
|
||||
arg: 'absences',
|
||||
type: 'number'
|
||||
},
|
||||
{
|
||||
arg: 'holidays',
|
||||
type: 'number'
|
||||
type: 'object',
|
||||
root: true
|
||||
}],
|
||||
http: {
|
||||
path: `/absences`,
|
||||
path: `/holidays`,
|
||||
verb: 'GET'
|
||||
}
|
||||
});
|
||||
|
||||
Self.absences = async(ctx, businessFk, year) => {
|
||||
Self.holidays = async(ctx, businessFk, year) => {
|
||||
const models = Self.app.models;
|
||||
const calendar = {totalHolidays: 0, holidaysEnjoyed: 0};
|
||||
const holidays = [];
|
||||
|
|
Loading…
Reference in New Issue