eletrotupi / tcc/ commit / 6b006f2

api: don't wrap care actions show endpoint

Pedro Lucas Porcellis porcellis@eletrotupi.com · 4 months ago 6b006f28cdcc256212589357ed92e3c06f935c2a Browse files
Parents 2984ae1
Changed files
1
Additions
+1
Deletions
-1
api/src/controllers/careActions.ts
1 1
import { Response, NextFunction } from 'express';
2 2
import { AuthenticatedRequest } from '@app/middleware/auth';
3 3
import { CareActionType } from '@prisma/client';
4 4
import { CreateCareActionSchema } from '@app/schemas';
5 5
import {
35 35

36 36
      if (!careAction) {
37 37
        return res.status(404).json({ errors: 'Care action was not found' });
38 38
      }
39 39

40 -
      return res.status(200).json({ careAction });
40 +
      return res.status(200).json(careAction);
41 41
    } catch (err) {
42 42
      next(err);
43 43
    }
44 44
  },
45 45

70 70
    } catch (err) {
71 71
      next(err);
72 72
    }
73 73
  },
74 74
};