Nextcloud Login refactoring
This commit is contained in:
@@ -77,7 +77,7 @@ class CookbookApiV1: CookbookApi {
|
||||
if let id = json as? Int {
|
||||
return nil
|
||||
} else if let dict = json as? [String: Any] {
|
||||
return .serverError
|
||||
return .unknownError
|
||||
}
|
||||
} catch {
|
||||
return .decodingFailed
|
||||
@@ -103,7 +103,7 @@ class CookbookApiV1: CookbookApi {
|
||||
|
||||
static func updateRecipe(auth: String, recipe: Recipe) async -> (NetworkError?) {
|
||||
let cookbookRecipe = CookbookApiRecipeDetailV1.fromRecipe(recipe)
|
||||
guard let recipeData = JSONEncoder.safeEncode(recipe) else {
|
||||
guard let recipeData = JSONEncoder.safeEncode(cookbookRecipe) else {
|
||||
return .dataError
|
||||
}
|
||||
let request = ApiRequest(
|
||||
@@ -121,7 +121,7 @@ class CookbookApiV1: CookbookApi {
|
||||
if let id = json as? Int {
|
||||
return nil
|
||||
} else if let dict = json as? [String: Any] {
|
||||
return .serverError
|
||||
return .unknownError
|
||||
}
|
||||
} catch {
|
||||
return .decodingFailed
|
||||
@@ -143,7 +143,7 @@ class CookbookApiV1: CookbookApi {
|
||||
return nil
|
||||
}
|
||||
|
||||
static func getCategories(auth: String) async -> ([Category]?, NetworkError?) {
|
||||
static func getCategories(auth: String) async -> ([CookbookApiCategory]?, NetworkError?) {
|
||||
let request = ApiRequest(
|
||||
path: basePath + "/categories",
|
||||
method: .GET,
|
||||
|
||||
Reference in New Issue
Block a user