chore: update
This commit is contained in:
@@ -161,7 +161,7 @@ public class ShiftService {
|
||||
@Description("Quản lý xóa một ca trực")
|
||||
@RolesAllowed(Role.Manager)
|
||||
@Transactional
|
||||
public boolean deleteShift(@Name("id") Long id) throws GraphQLException {
|
||||
public boolean deleteShift(@Name("id") UUID id) throws GraphQLException {
|
||||
String ownerId = request.getHeader(InternalValue.userId);
|
||||
|
||||
EateryEntity eatery = EateryEntity.findByOwnerId(ownerId);
|
||||
|
||||
@@ -145,6 +145,8 @@ public class ShiftServiceTest {
|
||||
given()
|
||||
.contentType("application/json")
|
||||
.header(InternalValue.userId, staffId.toString())
|
||||
.header(InternalValue.managerId, ownerId.toString())
|
||||
.header(InternalValue.role, Role.Staff)
|
||||
.body("{ \"query\": \"" + mutation + "\" }")
|
||||
.when()
|
||||
.post("/graphql")
|
||||
@@ -164,8 +166,7 @@ public class ShiftServiceTest {
|
||||
"12:00:00",
|
||||
eatery
|
||||
);
|
||||
UUID staffId = UUID.randomUUID();
|
||||
registerStaffToShift(staffId, shift);
|
||||
registerStaffToShift(UUID.randomUUID(), shift);
|
||||
|
||||
String mutation = String.format(
|
||||
"mutation { deleteShift(id: \\\"%s\\\") }",
|
||||
@@ -173,6 +174,8 @@ public class ShiftServiceTest {
|
||||
);
|
||||
|
||||
given()
|
||||
.header(InternalValue.userId, ownerId.toString())
|
||||
.header(InternalValue.role, Role.Manager)
|
||||
.contentType("application/json")
|
||||
.body("{ \"query\": \"" + mutation + "\" }")
|
||||
.when()
|
||||
|
||||
Reference in New Issue
Block a user