mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-03-13 15:39:18 +08:00
Fix note adding
This commit is contained in:
parent
07a33e7599
commit
0918f80d53
@ -509,7 +509,9 @@ public class ProjectsController extends HangarController {
|
||||
ObjectNode note = messages.addObject();
|
||||
note.put("message", content);
|
||||
note.put("user", userService.getCurrentUser().getId());
|
||||
projectDao.get().update(projectData.getProject()); // TODO check why this doesn't update notes
|
||||
|
||||
String json = projectData.getProject().getNotes().getJson().toString();
|
||||
projectDao.get().updateNotes(json, projectData.getProject().getId());
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.papermc.hangar.db.dao;
|
||||
|
||||
import io.papermc.hangar.db.customtypes.JSONB;
|
||||
import io.papermc.hangar.db.model.ProjectsTable;
|
||||
import io.papermc.hangar.db.model.UserProjectRolesTable;
|
||||
import io.papermc.hangar.db.model.UsersTable;
|
||||
@ -38,6 +39,9 @@ public interface ProjectDao {
|
||||
"recommended_version_id = :recommendedVersionId, notes = :notes WHERE id = :id")
|
||||
void update(@BindBean ProjectsTable project);
|
||||
|
||||
@SqlUpdate("UPDATE projects SET notes = cast(:notes as jsonb) WHERE id = :id") //TODO check why we have to cast and can't just update (this works tho)
|
||||
void updateNotes(String notes, long id);
|
||||
|
||||
@SqlUpdate("DELETE FROM projects WHERE id = :id")
|
||||
void delete(@BindBean ProjectsTable project);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user