aboutsummaryrefslogtreecommitdiff
path: root/QSThingsPlugin/Actions/CompleteTaskAction.m
diff options
context:
space:
mode:
authorRuben Beltran del Rio <git@r.bdr.sh>2025-09-10 22:48:37 +0200
committerRuben Beltran del Rio <git@r.bdr.sh>2025-09-10 22:48:37 +0200
commit1613c951d49e6d85aff52f312d57fa087b35c079 (patch)
treec31b74c56f32c3a60e628c187b6f7c236fffe36e /QSThingsPlugin/Actions/CompleteTaskAction.m
parent7cf393095282077b0bbae3046826b67f4f20a8eb (diff)
Move things URL calls to a helper
Diffstat (limited to 'QSThingsPlugin/Actions/CompleteTaskAction.m')
-rw-r--r--QSThingsPlugin/Actions/CompleteTaskAction.m10
1 files changed, 4 insertions, 6 deletions
diff --git a/QSThingsPlugin/Actions/CompleteTaskAction.m b/QSThingsPlugin/Actions/CompleteTaskAction.m
index 9673840..5ff1bd0 100644
--- a/QSThingsPlugin/Actions/CompleteTaskAction.m
+++ b/QSThingsPlugin/Actions/CompleteTaskAction.m
@@ -15,17 +15,15 @@ NS_ASSUME_NONNULL_BEGIN
if (authenticationKey && [validTypes containsObject:directObject.primaryType]) {
NSDictionary *contents = [directObject objectForType:directObject.primaryType];
- NSString *path = @"update";
+ ThingsURLRoute route = ThingsURLRouteUpdate;
if (directObject.primaryType == kProjectType) {
- path = @"update-project";
+ route = ThingsURLRouteUpdateProject;
}
if (contents) {
NSString *uuid = [contents objectForKey:@"uuid"];
if (uuid) {
- NSString *urlString = [NSString stringWithFormat:@"things:///%@?id=%@&auth-token=%@&completed=true", path, uuid, authenticationKey];
- NSURL *url = [NSURL URLWithString:urlString];
-
- [[NSWorkspace sharedWorkspace] openURL:url];
+ NSDictionary *parameters = @{@"id": uuid, @"completed": @"true"};
+ [ThingsHelper callRoute:route withParameters:parameters];
} else {
NSLog(@"Things object did not have a uuid.");
}