🧑💻 feat: Modify some endpoints to match gPodder.net ones
This commit is contained in:
parent
33fee28c02
commit
9a411358ca
@ -19,7 +19,7 @@ return [
|
||||
['name' => 'opml#import', 'url' => '/opml/import', 'verb' => 'POST'],
|
||||
['name' => 'podcast#index', 'url' => '/podcast', 'verb' => 'GET'],
|
||||
['name' => 'search#index', 'url' => '/search', 'verb' => 'GET'],
|
||||
['name' => 'tops#hot', 'url' => '/tops/hot', 'verb' => 'GET'],
|
||||
['name' => 'tops#new', 'url' => '/tops/new', 'verb' => 'GET'],
|
||||
['name' => 'toplist#hot', 'url' => '/toplist/hot', 'verb' => 'GET'],
|
||||
['name' => 'toplist#new', 'url' => '/toplist/new', 'verb' => 'GET'],
|
||||
],
|
||||
];
|
||||
|
@ -19,7 +19,7 @@ class SearchController extends Controller
|
||||
parent::__construct(Application::APP_ID, $request);
|
||||
}
|
||||
|
||||
public function index(string $value): JSONResponse {
|
||||
return new JSONResponse($this->multiPodService->search($value));
|
||||
public function index(string $q): JSONResponse {
|
||||
return new JSONResponse($this->multiPodService->search($q));
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ use OCP\AppFramework\Controller;
|
||||
use OCP\AppFramework\Http\JSONResponse;
|
||||
use OCP\IRequest;
|
||||
|
||||
class TopsController extends Controller
|
||||
class ToplistController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
IRequest $request,
|
@ -61,7 +61,7 @@ export default {
|
||||
try {
|
||||
this.loading = true
|
||||
const currentSearch = this.value
|
||||
const feeds = await axios.get(generateUrl('/apps/repod/search?value={value}', { value: currentSearch }))
|
||||
const feeds = await axios.get(generateUrl('/apps/repod/search?q={value}', { value: currentSearch }))
|
||||
if (currentSearch === this.value) {
|
||||
this.feeds = [...feeds.data].sort((a, b) => b.fetchedAtUnix - a.fetchedAtUnix)
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ import { showError } from '@nextcloud/dialogs'
|
||||
import { toUrl } from '../../utils/url.js'
|
||||
|
||||
export default {
|
||||
name: 'Tops',
|
||||
name: 'Toplist',
|
||||
components: {
|
||||
Loading,
|
||||
},
|
||||
@ -51,7 +51,7 @@ export default {
|
||||
async mounted() {
|
||||
try {
|
||||
this.loading = true
|
||||
const tops = await axios.get(generateUrl(`/apps/repod/tops/${this.type}`))
|
||||
const tops = await axios.get(generateUrl(`/apps/repod/toplist/${this.type}`))
|
||||
this.tops = tops.data
|
||||
} catch (e) {
|
||||
console.error(e)
|
@ -4,8 +4,8 @@
|
||||
<Magnify :size="20" />
|
||||
</NcTextField>
|
||||
<Search v-if="search" :value="search" />
|
||||
<Tops v-if="!search" type="hot" />
|
||||
<Tops v-if="!search" type="new" />
|
||||
<Toplist v-if="!search" type="hot" />
|
||||
<Toplist v-if="!search" type="new" />
|
||||
<AddRss v-if="!search" />
|
||||
</AppContent>
|
||||
</template>
|
||||
@ -16,7 +16,7 @@ import AppContent from '../components/Atoms/AppContent.vue'
|
||||
import Magnify from 'vue-material-design-icons/Magnify.vue'
|
||||
import { NcTextField } from '@nextcloud/vue'
|
||||
import Search from '../components/Discover/Search.vue'
|
||||
import Tops from '../components/Discover/Tops.vue'
|
||||
import Toplist from '../components/Discover/Toplist.vue'
|
||||
|
||||
export default {
|
||||
name: 'Discover',
|
||||
@ -26,7 +26,7 @@ export default {
|
||||
Magnify,
|
||||
NcTextField,
|
||||
Search,
|
||||
Tops,
|
||||
Toplist,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user