mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-15 18:28:47 +00:00
Finish ON DUPLICATE in list sharing
This commit is contained in:
parent
b478ace552
commit
2c23331354
@ -22,7 +22,7 @@ public class ListSharer implements CallHandler {
|
||||
}
|
||||
|
||||
final private String CHECK_ACCESS = "SELECT * from ListSharee WHERE listID = ? AND userID = ?;";
|
||||
final private String SHARE_LIST = "INSERT INTO ListSharee(listID, userID, permissionLevel) VALUES(?, ?, ?) ON DUPLICATE;";
|
||||
final private String SHARE_LIST = "INSERT INTO ListSharee(listID, userID, permissionLevel) VALUES(?, ?, ?) ON DUPLICATE KEY UPDATE permissionLevel = ?;";
|
||||
|
||||
public Object conductAction(Map<String, Object> bodyMap, HashMap<String, String> queryString, String cognitoID) throws SQLException {
|
||||
PreparedStatement checkAccess = connection.prepareStatement(CHECK_ACCESS);
|
||||
@ -67,6 +67,7 @@ public class ListSharer implements CallHandler {
|
||||
shareList.setString(2, shareWithSub);
|
||||
Integer permissionLevel = Integer.parseInt(bodyMap.get("permissionLevel").toString());
|
||||
shareList.setInt(3, permissionLevel);
|
||||
shareList.setInt(4, permissionLevel);
|
||||
shareList.executeUpdate();
|
||||
connection.commit();
|
||||
return null;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user