database error message, date sorting
This commit is contained in:
+1
-1
@@ -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))
|
||||
}
|
||||
|
||||
+2
-1
@@ -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();
|
||||
|
||||
|
||||
@@ -54,3 +54,7 @@ a,
|
||||
font-size: 21px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user