Skip to content

Commit b3346df

Browse files
committed
Removing check on saveCommand() to allow mixed environment of server generated and custom objectId with allowCustomObjectId = true
1 parent f6b2230 commit b3346df

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Sources/ParseSwift/API/API+Commands.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,9 @@ internal extension API.Command {
345345

346346
// MARK: Saving ParseObjects
347347
static func save<T>(_ object: T) throws -> API.Command<T, T> where T: ParseObject {
348-
if ParseSwift.configuration.allowCustomObjectId && object.objectId == nil {
349-
throw ParseError(code: .missingObjectId, message: "objectId must not be nil")
350-
}
348+
// if ParseSwift.configuration.allowCustomObjectId && object.objectId == nil {
349+
// throw ParseError(code: .missingObjectId, message: "objectId must not be nil")
350+
// }
351351
if object.isSaved {
352352
return update(object)
353353
}

Sources/ParseSwift/Objects/ParseInstallation.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -516,9 +516,9 @@ extension ParseInstallation {
516516
}
517517

518518
func saveCommand() throws -> API.Command<Self, Self> {
519-
if ParseSwift.configuration.allowCustomObjectId && objectId == nil {
520-
throw ParseError(code: .missingObjectId, message: "objectId must not be nil")
521-
}
519+
// if ParseSwift.configuration.allowCustomObjectId && objectId == nil {
520+
// throw ParseError(code: .missingObjectId, message: "objectId must not be nil")
521+
// }
522522
if isSaved {
523523
return updateCommand()
524524
}

Sources/ParseSwift/Objects/ParseUser.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -885,9 +885,9 @@ extension ParseUser {
885885
}
886886

887887
func saveCommand() throws -> API.Command<Self, Self> {
888-
if ParseSwift.configuration.allowCustomObjectId && objectId == nil {
889-
throw ParseError(code: .missingObjectId, message: "objectId must not be nil")
890-
}
888+
// if ParseSwift.configuration.allowCustomObjectId && objectId == nil {
889+
// throw ParseError(code: .missingObjectId, message: "objectId must not be nil")
890+
// }
891891
if isSaved {
892892
return updateCommand()
893893
}

0 commit comments

Comments
 (0)