clean up
This commit is contained in:
@ -1,8 +0,0 @@
|
||||
package app.omnivore.omnivore.core.data
|
||||
|
||||
import app.omnivore.omnivore.core.network.savedItemLabels
|
||||
|
||||
suspend fun DataService.syncLabels() {
|
||||
val fetchedLabels = networker.savedItemLabels()
|
||||
db.savedItemLabelDao().insertAll(fetchedLabels)
|
||||
}
|
||||
@ -6,19 +6,19 @@ import app.omnivore.omnivore.graphql.generated.type.CreateLabelInput
|
||||
import app.omnivore.omnivore.graphql.generated.type.SetLabelsInput
|
||||
|
||||
suspend fun Networker.updateLabelsForSavedItem(input: SetLabelsInput): List<SetLabelsMutation.Label>? {
|
||||
return try {
|
||||
val result = authenticatedApolloClient().mutation(SetLabelsMutation(input)).execute()
|
||||
return result.data?.setLabels?.onSetLabelsSuccess?.labels
|
||||
} catch (e: java.lang.Exception) {
|
||||
return null
|
||||
}
|
||||
return try {
|
||||
val result = authenticatedApolloClient().mutation(SetLabelsMutation(input)).execute()
|
||||
result.data?.setLabels?.onSetLabelsSuccess?.labels
|
||||
} catch (e: java.lang.Exception) {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun Networker.createNewLabel(input: CreateLabelInput): CreateLabelMutation.Label? {
|
||||
return try {
|
||||
val result = authenticatedApolloClient().mutation(CreateLabelMutation(input)).execute()
|
||||
return result.data?.createLabel?.onCreateLabelSuccess?.label
|
||||
} catch (e: java.lang.Exception) {
|
||||
null
|
||||
}
|
||||
return try {
|
||||
val result = authenticatedApolloClient().mutation(CreateLabelMutation(input)).execute()
|
||||
return result.data?.createLabel?.onCreateLabelSuccess?.label
|
||||
} catch (e: java.lang.Exception) {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user