Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KRP-561 e2e remove person, do not return user object #183

Merged
merged 3 commits into from
Feb 26, 2024
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
4 changes: 2 additions & 2 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kontist/mock-solaris",
"version": "1.0.122",
"version": "1.0.123",
"description": "Mock Service for Solaris API",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export const getPerson = async (personId: string): Promise<MockPerson> => {
return augmentPerson(person);
};

export const removePerson = async (personId: string): Promise<MockPerson> => {
export const removePerson = async (personId: string) => {
const person = await getPerson(personId);
const score = moment(person.createdAt).valueOf();
const key = `${process.env.MOCKSOLARIS_REDIS_PREFIX}:persons`;
Expand Down
5 changes: 3 additions & 2 deletions src/routes/persons.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import _ from "lodash";
import moment, { Moment } from "moment";
import HttpStatusCodes from "http-status";

import {
getPerson,
Expand Down Expand Up @@ -71,8 +72,8 @@ export const createPerson = async (req, res) => {
export const deletePerson = async (req, res) => {
const { id: personId } = req.params;
try {
const isPersonDeleted = await removePerson(personId);
return res.status(200).send(isPersonDeleted);
await removePerson(personId);
res.sendStatus(HttpStatusCodes.NO_CONTENT);
} catch (err) {
return res.status(500).send({
errors: [
Expand Down
Loading