diff --git a/packages/server/Containerfile b/packages/server/Containerfile index 221f675..c3e73dd 100644 --- a/packages/server/Containerfile +++ b/packages/server/Containerfile @@ -6,7 +6,7 @@ RUN apk --no-cache add ca-certificates WORKDIR /app -CMD ["node", "index.js"] +CMD ["node", "--enable-source-maps", "index.js"] COPY ./packages/server/dist/ . diff --git a/packages/server/src/api/endpoints/subscription.ts b/packages/server/src/api/endpoints/subscription.ts index 412076f..822f187 100644 --- a/packages/server/src/api/endpoints/subscription.ts +++ b/packages/server/src/api/endpoints/subscription.ts @@ -250,7 +250,14 @@ export function subscriptionEndpoints(server: FastifyInstance): void { ? getActiveUntilDate(subscription.lastPayment, subscription.anchorDate) : undefined; - await reply.send({ ...subscription, activeUntil }); + const _subscription = { + ...subscription, + activeUntil, + changes: subscription.changes.getItems().map((change) => ({ ...change, subscription: undefined })), + invoices: subscription.invoices.getItems().map((invoice) => ({ ...invoice, subscription: undefined })), + }; + + await reply.send(_subscription); }, }); } diff --git a/packages/server/src/api/index.ts b/packages/server/src/api/index.ts index 00de1fa..dfa221d 100644 --- a/packages/server/src/api/index.ts +++ b/packages/server/src/api/index.ts @@ -114,7 +114,7 @@ export async function init(): Promise { description: 'Documentation for the Gringotts api', version: '0.1.0', }, - host: 'localhost:3000', + host: `localhost:${config.port}`, schemes: ['http', 'https'], consumes: ['application/json'], produces: ['application/json'],