From 419ebd373edc924c583e82c06e2a82a7424bd102 Mon Sep 17 00:00:00 2001
From: joker
Date: Tue, 14 Feb 2023 21:36:58 +0300
Subject: [PATCH] modified: src/app/head.tsx modified:
src/app/layout.tsx modified: src/pages/api/podcasts/all.ts
modified: src/pages/api/podcasts/hobbits/rss/index.ts modified:
src/pages/api/podcasts/lets-go/rss/index.ts modified:
src/pages/api/podcasts/like-to-listen/rss/index.ts modified:
"src/\321\201omponents/podcasts/getRssXml.ts"
---
src/app/head.tsx | 4 ++--
src/app/layout.tsx | 18 ++++++++++++++++--
src/pages/api/podcasts/all.ts | 2 +-
src/pages/api/podcasts/hobbits/rss/index.ts | 2 +-
src/pages/api/podcasts/lets-go/rss/index.ts | 2 +-
.../api/podcasts/like-to-listen/rss/index.ts | 2 +-
src/сomponents/podcasts/getRssXml.ts | 2 +-
7 files changed, 23 insertions(+), 9 deletions(-)
diff --git a/src/app/head.tsx b/src/app/head.tsx
index 5ad797f..1ebc496 100644
--- a/src/app/head.tsx
+++ b/src/app/head.tsx
@@ -1,9 +1,9 @@
export default function Head() {
return (
<>
- Create Next App
+ BlogBaster
-
+
>
)
diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index 245bd75..5d9244b 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -8,8 +8,22 @@ export default function RootLayout({
return (
{/*
- will contain the components returned by the nearest parent
- head.tsx. Find out more at https://beta.nextjs.org/docs/api-reference/file-conventions/head
+
+
+
+
*/}
{children}
diff --git a/src/pages/api/podcasts/all.ts b/src/pages/api/podcasts/all.ts
index ca9facd..339d3fb 100644
--- a/src/pages/api/podcasts/all.ts
+++ b/src/pages/api/podcasts/all.ts
@@ -1,7 +1,7 @@
import Select from "../../../server/db/select";
import type { NextApiRequest, NextApiResponse } from 'next';
-const sql = "SELECT items.id, urlImg,items.description, items.title_items, items.audio FROM podcasts, items WHERE podcasts.id=items.id_podcasts and items.status=1";
+const sql = "SELECT items.id, urlImg,items.description, items.title_items, items.audio FROM podcasts, items WHERE podcasts.id=items.id_podcasts and items.status=1 ORDER BY items.pubDate DESC";
export default function handler(
req: NextApiRequest,
diff --git a/src/pages/api/podcasts/hobbits/rss/index.ts b/src/pages/api/podcasts/hobbits/rss/index.ts
index b6bed89..eb4a8d6 100644
--- a/src/pages/api/podcasts/hobbits/rss/index.ts
+++ b/src/pages/api/podcasts/hobbits/rss/index.ts
@@ -7,7 +7,7 @@ import { getRssXml, Items } from '../../../../../сomponents/podcasts';
const id = 1;
const sql_company = "SELECT * FROM podcasts, company WHERE podcasts.id="+id;
-const sql_items = "SELECT * FROM `podcasts`, items, company WHERE podcasts.id=items.id_podcasts and podcasts.id="+id;
+const sql_items = "SELECT * FROM `podcasts`, items, company WHERE podcasts.id=items.id_podcasts and podcasts.id="+id+" ORDER BY items.pubDate DESC";
const sql_userAgent = "INSERT INTO views (id_podcasts, userAgent,ip) VALUES (?,?,?)";
diff --git a/src/pages/api/podcasts/lets-go/rss/index.ts b/src/pages/api/podcasts/lets-go/rss/index.ts
index 7605e7d..d247096 100644
--- a/src/pages/api/podcasts/lets-go/rss/index.ts
+++ b/src/pages/api/podcasts/lets-go/rss/index.ts
@@ -7,7 +7,7 @@ import { getRssXml, Items } from '../../../../../сomponents/podcasts';
const id = 2;
const sql_company = "SELECT * FROM podcasts, company WHERE podcasts.id="+id;
-const sql_items = "SELECT * FROM `podcasts`, items, company WHERE podcasts.id=items.id_podcasts and podcasts.id="+id;
+const sql_items = "SELECT * FROM podcasts, items, company WHERE podcasts.id=items.id_podcasts and podcasts.id="+id+"ORDER BY items.pubDate DESC";
const sql_userAgent = "INSERT INTO views (id_podcasts, userAgent,ip) VALUES (?,?,?)";
diff --git a/src/pages/api/podcasts/like-to-listen/rss/index.ts b/src/pages/api/podcasts/like-to-listen/rss/index.ts
index 7a080e5..39adc0c 100644
--- a/src/pages/api/podcasts/like-to-listen/rss/index.ts
+++ b/src/pages/api/podcasts/like-to-listen/rss/index.ts
@@ -7,7 +7,7 @@ import { getRssXml, Items } from '../../../../../сomponents/podcasts';
const id = 3;
const sql_company = "SELECT * FROM podcasts, company WHERE podcasts.id="+id;
-const sql_items = "SELECT * FROM `podcasts`, items, company WHERE podcasts.id=items.id_podcasts and podcasts.id="+id;
+const sql_items = "SELECT * FROM `podcasts`, items, company WHERE podcasts.id=items.id_podcasts and podcasts.id="+id+"ORDER BY items.pubDate DESC";
const sql_userAgent = "INSERT INTO views (id_podcasts, userAgent,ip) VALUES (?,?,?)";
diff --git a/src/сomponents/podcasts/getRssXml.ts b/src/сomponents/podcasts/getRssXml.ts
index 753ef92..d1f422c 100644
--- a/src/сomponents/podcasts/getRssXml.ts
+++ b/src/сomponents/podcasts/getRssXml.ts
@@ -12,7 +12,7 @@ interface Props {
export const getRssXml = (data: Props) => {
let item =`
-
+