Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #92 from igrowker/maxi-backend-branch
Browse files Browse the repository at this point in the history
modified volunteerService, added _id in op.toString
  • Loading branch information
MaxiSalguero authored Dec 8, 2024
2 parents 272a4b6 + 53dc6a3 commit 9c27ce6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ const isAdminRoute = (path: string) => {
const app: Express = express();
app.use("/api", swaggerUi.serve, swaggerUi.setup(swaggerSpec));

app.use(cors());
app.use(cors({
origin: '*',
methods: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH'],
allowedHeaders: ['Content-Type', 'Authorization'],
}));
app.use(morgan("dev"));
app.use(express.json());

Expand Down
2 changes: 1 addition & 1 deletion src/services/volunteersServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const registerVolunteer = async (input: VolunteerRegistrationInput, userI
throw new Error('Refugio no encontrado');
}

const oportunidad = refugio.opportunities.find(op => op.toString() === oportunidadId);
const oportunidad = refugio.opportunities.find(op => op._id.toString() === oportunidadId);
if (!oportunidad) {
throw new Error('Oportunidad no encontrada en este refugio');
}
Expand Down

0 comments on commit 9c27ce6

Please sign in to comment.