database error message, date sorting

master
Mathias Rothenhaeusler 2023-11-19 14:03:03 +01:00
parent 91eeb29b06
commit 20d76c2a56
4 changed files with 8 additions and 2 deletions

View File

@ -8,5 +8,5 @@ pub fn establish_connection() -> PgConnection {
let database_url = env::var("DATABASE_URL").expect("DATABASE_URL must be set");
PgConnection::establish(&database_url)
.unwrap_or_else(|_| panic!("Error connecting to database {}", database_url))
.unwrap_or_else(|e| panic!("Error connecting to database {}: {}", database_url, e))
}

View File

@ -2,7 +2,7 @@ use crate::json_serialization::user::JsonUser;
use crate::models::feed::rss_feed::Feed;
use crate::models::feed_item::rss_feed_item::FeedItem;
use crate::reader::structs::feed::FeedAggregate;
use crate::schema::feed_item::{feed_id, read};
use crate::schema::feed_item::{feed_id, id, read};
use crate::{
database::establish_connection,
json_serialization::articles::Articles,
@ -31,6 +31,7 @@ pub async fn get(path: web::Path<JsonUser>, req: HttpRequest) -> impl Responder
let existing_item: Vec<FeedItem> = feed_item::table
.filter(feed_id.eq(feed.id))
.filter(read.eq(false))
.order(id.asc())
.load(&mut connection)
.unwrap();

View File

@ -54,3 +54,7 @@ a,
font-size: 21px;
font-weight: bold;
}
h3 {
font-size: 14px;
}

View File

@ -181,6 +181,7 @@ onMounted(() => {
<template v-for="( feed, index ) in feeds ">
<div v-bind:id="index" class="observe">
<h2 @click="getReadable(feed, index)" class="feed-title">{{ feed.title }}</h2>
<h3>{{ feed.timestamp }}</h3>
<p class="feed-content" v-html='feed.content'></p>
</div>
</template>