1
0
forked from PGL/Clyde

added every delete endpoint required

This commit is contained in:
2024-03-18 11:22:21 +01:00
parent a80fb2b297
commit 93c161be4c
9 changed files with 74 additions and 4 deletions

View File

@@ -77,4 +77,7 @@ public class CourseService {
return true;
}
public void delete(Course course) {
courseRepo.delete(course);
}
}

View File

@@ -19,4 +19,7 @@ public class CurriculumService {
return curriculumRepo.findById(id);
}
public void delete(Curriculum curriculum) {
curriculumRepo.delete(curriculum);
}
}

View File

@@ -87,4 +87,8 @@ public class InscriptionService {
save(inscrRequest);
return true;
}
public void delete(InscriptionRequest toDelete) {
inscriptionRepo.delete(toDelete);
}
}

View File

@@ -15,6 +15,10 @@ public class ProtectionService {
* @return all the user data without the password
*/
public static HashMap<String,Object> userWithoutPassword(User user){
if (user ==null)
return null;
HashMap<String,Object> toReturn = new HashMap<>();
toReturn.put("regNo",user.getRegNo());
@@ -42,6 +46,9 @@ public class ProtectionService {
public static HashMap<String,Object> courseWithoutPassword(Course course){
if (course == null)
return null;
HashMap<String ,Object> toReturn = new HashMap<>();
toReturn.put("courseId",course.getCourseID());
@@ -64,6 +71,10 @@ public class ProtectionService {
public static Map<String, Object> requestWithoutPassword(InscriptionRequest inscriptionRequest) {
if (inscriptionRequest == null)
return null;
Map<String, Object> toReturn = new HashMap<>();
toReturn.put("id", inscriptionRequest.getId());