aboutsummaryrefslogtreecommitdiff
path: root/QSThingsPlugin/Actions/CompleteTaskAction.m
diff options
context:
space:
mode:
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.");
}