import unarchived items by default

This commit is contained in:
Hongbo Wu
2023-10-30 16:22:09 +08:00
parent f6c0b2ba34
commit 8df6fb3ae2
5 changed files with 12 additions and 6 deletions

View File

@ -187,6 +187,7 @@ export const importer = Sentry.GCPFunction.wrapHttpFunction(
let offset = 0
let syncedAt = req.body.syncAt
const since = syncedAt
const state = req.body.state || State.UNARCHIVED // default to unarchived
console.log('importing pages from integration...')
// get pages from integration
@ -194,6 +195,7 @@ export const importer = Sentry.GCPFunction.wrapHttpFunction(
token: claims.token,
since,
offset,
state,
})
syncedAt = retrieved.since || Date.now()
@ -231,7 +233,7 @@ export const importer = Sentry.GCPFunction.wrapHttpFunction(
token: claims.token,
since,
offset,
state: req.body.state,
state,
})
syncedAt = retrieved.since || Date.now()
retrievedData = retrieved.data

View File

@ -23,7 +23,7 @@ export interface RetrieveRequest {
since?: number // unix timestamp in milliseconds
count?: number
offset?: number
state?: State
state: State
}
export abstract class IntegrationClient {

View File

@ -97,7 +97,7 @@ export class PocketClient extends IntegrationClient {
since = 0,
count = 100,
offset = 0,
state = State.UNARCHIVED,
state,
}: RetrieveRequest): Promise<RetrievedResult> => {
let pocketItemState = 'all'