mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
added SearchCore
This commit is contained in:
parent
d57aca1e85
commit
0d06de438f
@ -2,6 +2,7 @@ import SettingsCore from "./settings"
|
||||
import APICore from "./api"
|
||||
import StyleCore from "./style"
|
||||
import PermissionsCore from "./permissions"
|
||||
import SearchCore from "./search"
|
||||
|
||||
import I18nCore from "./i18n"
|
||||
import NotificationsCore from "./notifications"
|
||||
@ -14,12 +15,13 @@ import AudioPlayer from "./audioPlayer"
|
||||
export default [
|
||||
SettingsCore,
|
||||
APICore,
|
||||
SearchCore,
|
||||
PermissionsCore,
|
||||
StyleCore,
|
||||
I18nCore,
|
||||
SoundCore,
|
||||
NotificationsCore,
|
||||
ShortcutsCore,
|
||||
|
||||
|
||||
AudioPlayer,
|
||||
]
|
17
packages/app/src/cores/search/index.js
Normal file
17
packages/app/src/cores/search/index.js
Normal file
@ -0,0 +1,17 @@
|
||||
import Core from "evite/src/core"
|
||||
|
||||
export default class Search extends Core {
|
||||
static namespace = "searchEngine"
|
||||
static dependencies = ["api"]
|
||||
static public = ["search"]
|
||||
|
||||
apiBridge = null
|
||||
|
||||
search = async (keywords, params = {}) => {
|
||||
if (!this.apiBridge) {
|
||||
this.apiBridge = app.api.withEndpoints("main")
|
||||
}
|
||||
|
||||
return await this.apiBridge.get.search(undefined, { keywords: keywords, params })
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user