Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions controllers/oooRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ export const createOooRequestController = async (
}

const latestOooRequest: OooStatusRequest = await getRequestByKeyValues({
userId,
type: REQUEST_TYPE.OOO,
status: REQUEST_STATE.PENDING,
requestedBy: userId,
type: REQUEST_TYPE.OOO,
status: REQUEST_STATE.PENDING,
});

if (latestOooRequest) {
Expand Down
3 changes: 1 addition & 2 deletions services/oooRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ export const createOooRequest = async (
from: body.from,
until: body.until,
type: body.type,
requestedBy: username,
userId,
requestedBy: userId,
reason: body.reason,
comment: null,
status: REQUEST_STATE.PENDING,
Expand Down
3 changes: 1 addition & 2 deletions test/fixtures/oooRequest/oooRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ export const createdOOORequest = {
reason: validOooStatusRequests.reason,
status: "PENDING",
lastModifiedBy: null,
requestedBy: "suraj-maity-1",
userId: "jCqqOYCnm93mcmaYuSsQ",
requestedBy: "jCqqOYCnm93mcmaYuSsQ",
comment: null
};

Expand Down
3 changes: 1 addition & 2 deletions test/integration/requests.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,10 @@ describe("/requests OOO", function () {
expect(res.body).to.not.have.property("data");

await requestsQuery.getRequestByKeyValues({
userId: testUserId,
requestedBy: testUserId,
type: REQUEST_TYPE.OOO,
status: REQUEST_STATE.PENDING
}).then((request) => {
expect(request).to.not.be.null;
expect(request.reason).to.equal(validOooStatusRequests.reason);
done();
}).catch(done);
Expand Down
3 changes: 1 addition & 2 deletions test/unit/services/oooRequest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ describe("Test OOO Request Service", function() {
expect(response).to.deep.include({
...createdOOORequest,
id: response.id,
requestedBy:testUserName,
userId: testUserId
requestedBy: testUserId
});
});

Expand Down
Loading