createOrUpdateJetpack
Creates or updates a jetpack in the repository.
Return
A Result indicating the success or failure of the operation.
Parameters
jetpack
The Jetpack object to create or update.
Samples
return suspendRunCatching {
val userId = preferencesDataSource.getUserIdOrThrow()
localDataSource.upsertJetpack(
jetpack
.toJetpackEntity()
.copy(
userId = userId,
lastUpdated = System.currentTimeMillis(),
needsSync = true,
syncAction = SyncAction.UPSERT,
),
)
syncManager.requestSync()
}Content copied to clipboard