Skip to content

Commit 43d9997

Browse files
committed
fix: Hooks should attempt to update if already exists
1 parent 7276ce7 commit 43d9997

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Sources/ParseServerSwift/Models/HookFunction.swift

+3
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ extension HookFunction {
5959
if error.containedIn([.webhookError]) && method == .POST {
6060
// swiftlint:disable:next line_length
6161
configuration.logger.warning("Hook Function: \"\(String(describing: hookFunction))\"; warning: \(error); on server: \(parseServerURLString)")
62+
return try await Self.method(method, path,
63+
name: name,
64+
parseServerURLStrings: parseServerURLStrings)
6265
} else {
6366
// swiftlint:disable:next line_length
6467
configuration.logger.error("Could not \(method) Hook Function: \"\(String(describing: hookFunction))\"; error: \(error); on server: \(parseServerURLString)")

Sources/ParseServerSwift/Models/HookTrigger.swift

+4
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ extension HookTrigger {
6969
if error.containedIn([.webhookError]) && method == .POST {
7070
// swiftlint:disable:next line_length
7171
configuration.logger.warning("Hook Trigger: \"\(String(describing: hookTrigger))\"; warning: \(error); on server: \(parseServerURLString)")
72+
return try await Self.method(method, path,
73+
className: className,
74+
triggerName: triggerName,
75+
parseServerURLStrings: parseServerURLStrings)
7276
} else {
7377
// swiftlint:disable:next line_length
7478
configuration.logger.error("Could not \(method) Hook Trigger: \"\(String(describing: hookTrigger))\"; error: \(error); on server: \(parseServerURLString)")

0 commit comments

Comments
 (0)