From c6aaf661bf2e68f5b4004447fdd0fb6d1b4ef20a Mon Sep 17 00:00:00 2001 From: Stanislav Romanov Date: Fri, 2 Sep 2022 08:18:58 +0300 Subject: [PATCH] Clear code --- app/models/document.js | 14 -------------- app/models/index.js | 7 ------- app/templates/admin/index.hbs | 4 +++- 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/app/models/document.js b/app/models/document.js index 881f9d4..51b5cdc 100644 --- a/app/models/document.js +++ b/app/models/document.js @@ -1,21 +1,7 @@ -import query from '../utils/query'; - export default class Document { constructor(data = {}) { for (const key in data) { this[key] = data[key]; } } - - // get path() { - // return `${this.#index.path}/documents/${this.documentId}`; - // } - - // get isNew() { - // return Boolean(!this.documentId); - // } - - // get documentId() { - // return this[this.#index.primaryKey]; - // } } diff --git a/app/models/index.js b/app/models/index.js index 25e6c66..3665b52 100644 --- a/app/models/index.js +++ b/app/models/index.js @@ -1,4 +1,3 @@ -import jsonParse from '../helpers/json-parse'; import query from '../utils/query'; // import { TrackedArray } from 'tracked-built-ins'; // import { trackedFunction } from 'ember-resources/util/function'; @@ -27,12 +26,6 @@ export default class Index { return query(`${this.path}/stats`); } - // getDocuments(searchParams) { - // return query(`${this.path}/documents`, { - // body: searchParams, - // }); - // } - getDocument(uid) { return query(`${this.path}/documents/${uid}`).then( (result) => new Document(result) diff --git a/app/templates/admin/index.hbs b/app/templates/admin/index.hbs index d1bae70..73146f2 100644 --- a/app/templates/admin/index.hbs +++ b/app/templates/admin/index.hbs @@ -36,7 +36,9 @@ - + + Indexes +