mirror of
https://github.com/streetwriters/notesnook-sync-server.git
synced 2026-02-12 19:22:45 +00:00
sync: make tags & colors syncable
This commit is contained in:
@@ -34,6 +34,8 @@ namespace Notesnook.API.Accessors
|
||||
public SyncItemsRepository<Content> Contents { get; }
|
||||
public SyncItemsRepository<Setting> Settings { get; }
|
||||
public SyncItemsRepository<Attachment> Attachments { get; }
|
||||
public SyncItemsRepository<Color> Colors { get; }
|
||||
public SyncItemsRepository<Tag> Tags { get; }
|
||||
public Repository<UserSettings> UsersSettings { get; }
|
||||
public Repository<Monograph> Monographs { get; }
|
||||
|
||||
@@ -45,6 +47,8 @@ namespace Notesnook.API.Accessors
|
||||
SyncItemsRepository<Shortcut> _shortcuts,
|
||||
SyncItemsRepository<Relation> _relations,
|
||||
SyncItemsRepository<Reminder> _reminders,
|
||||
SyncItemsRepository<Color> _colors,
|
||||
SyncItemsRepository<Tag> _tags,
|
||||
Repository<UserSettings> _usersSettings,
|
||||
Repository<Monograph> _monographs)
|
||||
{
|
||||
@@ -58,6 +62,8 @@ namespace Notesnook.API.Accessors
|
||||
Shortcuts = _shortcuts;
|
||||
Reminders = _reminders;
|
||||
Relations = _relations;
|
||||
Colors = _colors;
|
||||
Tags = _tags;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,8 @@ namespace Notesnook.API.Interfaces
|
||||
SyncItemsRepository<Content> Contents { get; }
|
||||
SyncItemsRepository<Setting> Settings { get; }
|
||||
SyncItemsRepository<Attachment> Attachments { get; }
|
||||
SyncItemsRepository<Color> Colors { get; }
|
||||
SyncItemsRepository<Tag> Tags { get; }
|
||||
Repository<UserSettings> UsersSettings { get; }
|
||||
Repository<Monograph> Monographs { get; }
|
||||
}
|
||||
|
||||
@@ -124,4 +124,10 @@ namespace Notesnook.API.Models
|
||||
|
||||
[BsonCollection("notesnook", "shortcuts")]
|
||||
public class Shortcut : SyncItem { }
|
||||
|
||||
[BsonCollection("notesnook", "tags")]
|
||||
public class Tag : SyncItem { }
|
||||
|
||||
[BsonCollection("notesnook", "colors")]
|
||||
public class Color : SyncItem { }
|
||||
}
|
||||
|
||||
@@ -175,6 +175,8 @@ namespace Notesnook.API.Services
|
||||
Repositories.Attachments.DeleteByUserId(userId);
|
||||
Repositories.Reminders.DeleteByUserId(userId);
|
||||
Repositories.Relations.DeleteByUserId(userId);
|
||||
Repositories.Colors.DeleteByUserId(userId);
|
||||
Repositories.Tags.DeleteByUserId(userId);
|
||||
Repositories.UsersSettings.Delete((u) => u.UserId == userId);
|
||||
Repositories.Monographs.DeleteMany((m) => m.UserId == userId);
|
||||
|
||||
@@ -216,6 +218,8 @@ namespace Notesnook.API.Services
|
||||
Repositories.Attachments.DeleteByUserId(userId);
|
||||
Repositories.Reminders.DeleteByUserId(userId);
|
||||
Repositories.Relations.DeleteByUserId(userId);
|
||||
Repositories.Colors.DeleteByUserId(userId);
|
||||
Repositories.Tags.DeleteByUserId(userId);
|
||||
Repositories.Monographs.DeleteMany((m) => m.UserId == userId);
|
||||
if (!await unit.Commit()) return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user