working on bookmark editing
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -218,10 +218,16 @@ CREATE TABLE IF NOT EXISTS {0} (
|
||||
|
||||
@Override
|
||||
public void deleteEntity(String module, long entityId) {
|
||||
deleteEntity(module,entityId,-1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteEntity(String module, long entityId, long userId) {
|
||||
try {
|
||||
Query.delete().from(TABLE_TAGS)
|
||||
.where(MODULE,iEqual(module)).where(ENTITY_ID,equal(entityId))
|
||||
.execute(db);
|
||||
var query = Query.delete().from(TABLE_TAGS)
|
||||
.where(MODULE,iEqual(module)).where(ENTITY_ID,equal(entityId));
|
||||
if (userId>0) query.where(USER_ID,equal(userId));
|
||||
query.execute(db);
|
||||
} catch (SQLException e){
|
||||
throw failedToDropObject(Translatable.t("{module}.{id}", MODULE,module, ID,entityId)).causedBy(e);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ public interface TagDB {
|
||||
|
||||
void deleteEntity(String module, long entityId);
|
||||
|
||||
void deleteEntity(String module, long entityId, long userId);
|
||||
|
||||
Map<String, List<Long>> getUses(String tag, long id);
|
||||
|
||||
Collection<Tuple<String, Long>> list(long userId);
|
||||
|
||||
@@ -134,6 +134,11 @@ public class TagModule extends BaseHandler implements TagService {
|
||||
return sendContent(ex,tuples.map(t -> Map.of(TAG,t.a,COUNT,t.b)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteEntity(String module, long entityId, long userId) {
|
||||
tagDb.deleteEntity(module,entityId,userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(String module, long entityId, Collection<Long> userIds, Collection<String> tags) {
|
||||
tagDb.save(userIds,module,entityId,tags);
|
||||
|
||||
Reference in New Issue
Block a user