mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 08:34:29 +00:00
fix(news Widget api): readds the removed api call from the news widget because it differs from the getNews api call that is used in the News View
This commit is contained in:
@@ -40,21 +40,6 @@ export default {
|
||||
return this.allNewsList.find(news => news.minimized === false) ?? this.allNewsList[0] ?? null
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$fhcApi.factory.cms
|
||||
.news(MAX_LOADED_NEWS)
|
||||
.then((res) => {
|
||||
this.allNewsList = Array.from(Object.values(res.data));
|
||||
|
||||
this.selected = this.allNewsList.length ? this.allNewsList[0] : null
|
||||
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error("ERROR: ", err.response.data);
|
||||
});
|
||||
|
||||
this.$emit("setConfig", false);
|
||||
},
|
||||
methods: {
|
||||
setNext(){
|
||||
const thisIndex = this.allNewsList.findIndex(n=>n.news_id == this.selected.news_id)
|
||||
@@ -133,6 +118,22 @@ export default {
|
||||
this.$refs.newsModal.show();
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.$fhcApi.factory.cms
|
||||
.news(MAX_LOADED_NEWS)
|
||||
.then(res => res.data)
|
||||
.then((news) => {
|
||||
this.allNewsList = Array.from(Object.values(news));
|
||||
|
||||
this.selected = this.allNewsList.length ? this.allNewsList[0] : null
|
||||
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error("ERROR: ", err.response.data);
|
||||
});
|
||||
|
||||
this.$emit("setConfig", false);
|
||||
},
|
||||
template: /*html*/ `
|
||||
<div class="widgets-news h-100" :style="getNewsWidgetStyle">
|
||||
<div class="d-flex flex-column h-100">
|
||||
|
||||
Reference in New Issue
Block a user