2020-10-27 16:07:01 +03:00
|
|
|
import ApplicationAdapter from './application';
|
2022-02-02 19:57:22 +03:00
|
|
|
import classic from 'ember-classic-decorator';
|
2020-10-27 16:07:01 +03:00
|
|
|
|
2022-02-02 19:57:22 +03:00
|
|
|
@classic
|
|
|
|
export default class ApiKey extends ApplicationAdapter {
|
2020-10-27 16:07:01 +03:00
|
|
|
queryRecord(store, type, query) {
|
|
|
|
if (!query || query.id !== 'me') {
|
2022-02-02 19:57:22 +03:00
|
|
|
return super.queryRecord(...arguments);
|
2020-10-27 16:07:01 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
let url = `${this.buildURL('users', 'me')}token/`;
|
|
|
|
return this.ajax(url, 'GET', {data: {}}).then((data) => {
|
|
|
|
return data;
|
|
|
|
});
|
|
|
|
}
|
2022-02-02 19:57:22 +03:00
|
|
|
}
|