Merge pull request #3669 from omnivore-app/fix/popular-reads
add popular reads to the continue reading section of new user library
This commit is contained in:
@ -58,6 +58,8 @@ export const libraryItemRepository = appDataSource
|
||||
},
|
||||
|
||||
createByPopularRead(name: string, userId: string) {
|
||||
// set read_at to now and reading_progress_bottom_percent to 2
|
||||
// so the items show up in continue reading section
|
||||
return this.query(
|
||||
`
|
||||
INSERT INTO omnivore.library_item (
|
||||
@ -73,7 +75,9 @@ export const libraryItemRepository = appDataSource
|
||||
published_at,
|
||||
site_name,
|
||||
user_id,
|
||||
word_count
|
||||
word_count,
|
||||
read_at,
|
||||
reading_progress_bottom_percent
|
||||
)
|
||||
SELECT
|
||||
slug,
|
||||
@ -88,7 +92,9 @@ export const libraryItemRepository = appDataSource
|
||||
published_at,
|
||||
site_name,
|
||||
$2,
|
||||
word_count
|
||||
word_count,
|
||||
NOW(),
|
||||
2
|
||||
FROM
|
||||
omnivore.popular_read
|
||||
WHERE
|
||||
|
||||
@ -591,7 +591,7 @@ describe('auth router', () => {
|
||||
await deleteUser(user.id)
|
||||
})
|
||||
|
||||
it('adds popular reads to the library', async () => {
|
||||
it('adds popular reads to the continue reading section', async () => {
|
||||
const pendingUserToken = await createPendingUserToken({
|
||||
sourceUserId,
|
||||
email,
|
||||
@ -608,7 +608,7 @@ describe('auth router', () => {
|
||||
).expect(200)
|
||||
const user = await userRepository.findOneByOrFail({ name })
|
||||
const { count } = await searchLibraryItems(
|
||||
{ query: 'in:all' },
|
||||
{ query: 'in:inbox sort:read-desc is:reading' },
|
||||
user.id
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user