aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api/resource/CalendarResource.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/api/resource/CalendarResource.java')
-rw-r--r--src/org/traccar/api/resource/CalendarResource.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/org/traccar/api/resource/CalendarResource.java b/src/org/traccar/api/resource/CalendarResource.java
index 30f5df6b8..a0f8656af 100644
--- a/src/org/traccar/api/resource/CalendarResource.java
+++ b/src/org/traccar/api/resource/CalendarResource.java
@@ -35,6 +35,7 @@ import org.traccar.Context;
import org.traccar.api.BaseResource;
import org.traccar.database.CalendarManager;
import org.traccar.model.Calendar;
+import org.traccar.model.User;
@Path("calendars")
@Produces(MediaType.APPLICATION_JSON)
@@ -66,7 +67,7 @@ public class CalendarResource extends BaseResource {
public Response add(Calendar entity) throws SQLException {
Context.getPermissionsManager().checkReadonly(getUserId());
Context.getCalendarManager().addItem(entity);
- linkNewEntity(entity);
+ Context.getDataManager().linkObject(User.class, getUserId(), entity.getClass(), entity.getId(), true);
Context.getCalendarManager().refreshUserItems();
return Response.ok(entity).build();
}