Skip to content

Commit

Permalink
API access for data in the LocalChangeEntity table
Browse files Browse the repository at this point in the history
  • Loading branch information
ndegwamartin committed Aug 23, 2023
1 parent a8ecbdb commit e6c64af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion engine/src/main/java/com/google/android/fhir/FhirEngine.kt
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ interface FhirEngine {
* an empty list.
*/
suspend fun getLocalChanges(type: ResourceType, id: String): List<LocalChange>

suspend fun getUnsyncedLocalChanges(): List<SquashedLocalChange>
/**
* Purges a resource from the database based on resource type and id without any deletion of data
* from the server.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ internal class FhirEngineImpl(private val database: Database, private val contex
override suspend fun getLocalChanges(type: ResourceType, id: String): List<LocalChange> {
return database.getLocalChanges(type, id)
}
// FhirEngineImpl.kt
override suspend fun getUnsyncedLocalChanges(): List<SquashedLocalChange> =
database.getAllLocalChanges()

override suspend fun purge(type: ResourceType, id: String, forcePurge: Boolean) {
database.purge(type, id, forcePurge)
Expand Down

0 comments on commit e6c64af

Please sign in to comment.