Restructure homepage: Hero, Termine, News, Actions in new order
This commit is contained in:
32
.output/server/chunks/routes/api/news-public.get.mjs
Normal file
32
.output/server/chunks/routes/api/news-public.get.mjs
Normal file
@@ -0,0 +1,32 @@
|
||||
import { d as defineEventHandler } from '../../nitro/nitro.mjs';
|
||||
import { r as readNews } from '../../_/news.mjs';
|
||||
import 'node:http';
|
||||
import 'node:https';
|
||||
import 'node:events';
|
||||
import 'node:buffer';
|
||||
import 'node:fs';
|
||||
import 'node:path';
|
||||
import 'node:crypto';
|
||||
import 'node:url';
|
||||
import 'fs';
|
||||
import 'path';
|
||||
import 'crypto';
|
||||
|
||||
const newsPublic_get = defineEventHandler(async (event) => {
|
||||
try {
|
||||
const allNews = await readNews();
|
||||
const publicNews = allNews.filter((item) => item.isPublic === true);
|
||||
publicNews.sort((a, b) => new Date(b.created) - new Date(a.created));
|
||||
const latestNews = publicNews.slice(0, 3);
|
||||
return {
|
||||
success: true,
|
||||
news: latestNews
|
||||
};
|
||||
} catch (error) {
|
||||
console.error("Fehler beim Abrufen der \xF6ffentlichen News:", error);
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
|
||||
export { newsPublic_get as default };
|
||||
//# sourceMappingURL=news-public.get.mjs.map
|
||||
1
.output/server/chunks/routes/api/news-public.get.mjs.map
Normal file
1
.output/server/chunks/routes/api/news-public.get.mjs.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"news-public.get.mjs","sources":["../../../../../server/api/news-public.get.js"],"sourcesContent":null,"names":[],"mappings":";;;;;;;;;;;;;;AAEA,uBAAA,kBAAA,CAAA,OAAA,KAAA,KAAA;AACA,EAAA,IAAA;AACA,IAAA,MAAA,OAAA,GAAA,MAAA,QAAA,EAAA;AAGA,IAAA,MAAA,aAAA,OAAA,CAAA,MAAA,CAAA,CAAA,IAAA,KAAA,IAAA,CAAA,aAAA,IAAA,CAAA;AAGA,IAAA,UAAA,CAAA,IAAA,CAAA,CAAA,CAAA,EAAA,CAAA,KAAA,IAAA,IAAA,CAAA,CAAA,CAAA,OAAA,CAAA,GAAA,IAAA,IAAA,CAAA,CAAA,CAAA,OAAA,CAAA,CAAA;AAGA,IAAA,MAAA,UAAA,GAAA,UAAA,CAAA,KAAA,CAAA,CAAA,EAAA,CAAA,CAAA;AAEA,IAAA,OAAA;AAAA,MACA,OAAA,EAAA,IAAA;AAAA,MACA,IAAA,EAAA;AAAA,KACA;AAAA,EACA,SAAA,KAAA,EAAA;AACA,IAAA,OAAA,CAAA,KAAA,CAAA,iDAAA,KAAA,CAAA;AACA,IAAA,MAAA,KAAA;AAAA,EACA;AACA,CAAA,CAAA;;;;"}
|
||||
Reference in New Issue
Block a user