Clear code

This commit is contained in:
Stanislav Romanov 2022-09-02 08:18:58 +03:00
parent 9a3de61ea8
commit c6aaf661bf
3 changed files with 3 additions and 22 deletions

View file

@ -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];
// }
}

View file

@ -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)

View file

@ -36,7 +36,9 @@
</Stat>
</dl>
<Headers::H2 @title='Indexes' />
<Headers::H2>
<LinkTo @route='admin.indexes.index'>Indexes</LinkTo>
</Headers::H2>
<RoyalTable @data={{@model.indexes.results}} class='w-full' as |Row data|>
<Row as |Column|>