2024-06-27 17:27:40 +10:00
|
|
|
import RestAdapter from "discourse/adapters/rest";
|
|
|
|
|
|
2024-06-28 00:59:51 +02:00
|
|
|
export default class AiToolAdapter extends RestAdapter {
|
2024-06-27 17:27:40 +10:00
|
|
|
jsonMode = true;
|
|
|
|
|
|
|
|
|
|
basePath() {
|
|
|
|
|
return "/admin/plugins/discourse-ai/";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pathFor(store, type, findArgs) {
|
|
|
|
|
// removes underscores which are implemented in base
|
|
|
|
|
let path =
|
|
|
|
|
this.basePath(store, type, findArgs) +
|
|
|
|
|
store.pluralize(this.apiNameFor(type));
|
|
|
|
|
return this.appendQueryParams(path, findArgs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
apiNameFor() {
|
|
|
|
|
return "ai-tool";
|
|
|
|
|
}
|
|
|
|
|
}
|