UNPKG

ferngully-aurelia-tools

Version:

Ferngully Tools for Aurelia

50 lines 2.12 kB
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; import { autoinject, transient } from "aurelia-framework"; import { Ajax } from "../ajax"; let FormSchemaCrudService = class FormSchemaCrudService { constructor(ajax) { this.ajax = ajax; } getAll(init) { return this.ajax.fetchJson(`${this.webServiceName}/Get`, init) .then((result) => { return result.Data; }); } get(id) { return this.ajax.fetchJson(`${this.webServiceName}/Get/${id}`) .then((result) => { return result.Data; }); } delete(id) { return this.ajax.delete(`${this.webServiceName}/Delete/${id}`); } create() { return this.ajax.fetchJson(`${this.webServiceName}/Create`) .then((result) => { return result.Data; }); } insert(instance) { return this.ajax.post(`${this.webServiceName}/post`, instance); } update(id, instance, propertyName, newValue, oldValue) { return this.ajax.put(`${this.webServiceName}/Put/${id}`, { instance: instance, propertyName: propertyName }); } }; FormSchemaCrudService = __decorate([ autoinject, transient(), __metadata("design:paramtypes", [Ajax]) ], FormSchemaCrudService); export { FormSchemaCrudService }; //# sourceMappingURL=form-schema-crud-service.js.map