Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ document.addEventListener('alpine:init', () => {
await this.loadOptions();
if (this.id) {
try {
const record = await App.api.get(this.apiPath + '/' + this.id);
const record = await App.services.api.get(this.apiPath + '/' + this.id);
for (const key of Object.keys(this.form)) {
if (record[key] !== undefined && record[key] !== null) this.form[key] = record[key];
}
Expand Down Expand Up @@ -113,9 +113,9 @@ document.addEventListener('alpine:init', () => {
this.error = null;
try {
if (this.mode === 'edit') {
await App.api.put(this.apiPath + '/' + this.id, this.toPayload());
await App.services.api.put(this.apiPath + '/' + this.id, this.toPayload());
} else {
await App.api.post(this.apiPath, this.toPayload());
await App.services.api.post(this.apiPath, this.toPayload());
}
this.goBack();
} catch (e) {
Expand All @@ -128,7 +128,7 @@ document.addEventListener('alpine:init', () => {
async confirmDelete() {
this.deleteBusy = true;
try {
await App.api.del(this.apiPath + '/' + this.id);
await App.services.api.delete(this.apiPath + '/' + this.id);
this.deleteOpen = false;
this.goBack();
} catch (e) {
Expand Down Expand Up @@ -167,7 +167,7 @@ document.addEventListener('alpine:init', () => {
async loadChildren() {
for (const child of this.children) {
try {
child.rows = await App.api.get(child.apiPath + '?' + encodeURIComponent(child.fkProperty) + '=' + encodeURIComponent(this.id)) || [];
child.rows = await App.services.api.get(child.apiPath + '?' + encodeURIComponent(child.fkProperty) + '=' + encodeURIComponent(this.id)) || [];
if (child.calendar) child.calCfg = { view: child.calendar.view, events: this.buildEvents(child) };
child.state = 'default';
} catch (e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ document.addEventListener('alpine:init', () => {
async load() {
this.state = 'loading';
try {
this.items = await App.api.get(this.apiPath) || [];
this.items = await App.services.api.get(this.apiPath) || [];
this.state = this.items.length ? 'default' : 'empty';
} catch (e) {
this.error = (e && e.message) || 'Could not load your ${menuLabel}.';
Expand Down
Loading