mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
fix: date filter in bulk action api
This commit is contained in:
parent
27b352f9ae
commit
0c60706503
2 changed files with 6 additions and 8 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { Readability } from '@omnivore/readability'
|
||||
import { DeepPartial } from 'typeorm'
|
||||
import { QueryDeepPartialEntity } from 'typeorm/query-builder/QueryPartialEntity'
|
||||
import { Highlight } from '../entity/highlight'
|
||||
import { LibraryItem, LibraryItemState } from '../entity/library_item'
|
||||
import { User } from '../entity/user'
|
||||
import { homePageURL } from '../env'
|
||||
|
|
@ -166,12 +167,9 @@ export const savePage = async (
|
|||
}
|
||||
|
||||
if (parseResult.highlightData) {
|
||||
const highlight = {
|
||||
updatedAt: new Date(),
|
||||
createdAt: new Date(),
|
||||
userId: user.id,
|
||||
const highlight: DeepPartial<Highlight> = {
|
||||
...parseResult.highlightData,
|
||||
type: HighlightType.Highlight,
|
||||
user: { id: user.id },
|
||||
}
|
||||
|
||||
if (!(await createHighlight(highlight, clientRequestId, user.id))) {
|
||||
|
|
|
|||
|
|
@ -249,13 +249,13 @@ const parseDateFilter = (
|
|||
|
||||
switch (field.toUpperCase()) {
|
||||
case 'PUBLISHED':
|
||||
field = 'publishedAt'
|
||||
field = 'published_at'
|
||||
break
|
||||
case 'SAVED':
|
||||
field = 'savedAt'
|
||||
field = 'saved_at'
|
||||
break
|
||||
case 'UPDATED':
|
||||
field = 'updatedAt'
|
||||
field = 'updated_at'
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
|
|||
Loading…
Reference in a new issue