diff --git a/apps/backend/src/api/routes/billing.controller.ts b/apps/backend/src/api/routes/billing.controller.ts index 32afd36b..988eabc1 100644 --- a/apps/backend/src/api/routes/billing.controller.ts +++ b/apps/backend/src/api/routes/billing.controller.ts @@ -2,9 +2,10 @@ import { Body, Controller, Get, Param, Post } from '@nestjs/common'; import { SubscriptionService } from '@gitroom/nestjs-libraries/database/prisma/subscriptions/subscription.service'; import { StripeService } from '@gitroom/nestjs-libraries/services/stripe.service'; import { GetOrgFromRequest } from '@gitroom/nestjs-libraries/user/org.from.request'; -import { Organization } from '@prisma/client'; +import { Organization, User } from '@prisma/client'; import { BillingSubscribeDto } from '@gitroom/nestjs-libraries/dtos/billing/billing.subscribe.dto'; import { ApiTags } from '@nestjs/swagger'; +import { GetUserFromRequest } from '@gitroom/nestjs-libraries/user/user.from.request'; @ApiTags('Billing') @Controller('/billing') @@ -71,4 +72,17 @@ export class BillingController { ) { return this._stripeService.lifetimeDeal(org.id, body.code); } + + @Post('/add-subscription') + async addSubscription( + @Body() body: { subscription: string }, + @GetUserFromRequest() user: User, + @GetOrgFromRequest() org: Organization + ) { + if (!user.isSuperAdmin) { + throw new Error('Unauthorized'); + } + + await this._subscriptionService.addSubscription(org.id, user.id, body.subscription); + } } diff --git a/apps/backend/src/api/routes/copilot.controller.ts b/apps/backend/src/api/routes/copilot.controller.ts index 2f46b48a..e66a13fd 100644 --- a/apps/backend/src/api/routes/copilot.controller.ts +++ b/apps/backend/src/api/routes/copilot.controller.ts @@ -22,7 +22,7 @@ export class CopilotController { req?.body?.variables?.data?.metadata?.requestType === 'TextareaCompletion' ? 'gpt-4o-mini' - : 'gpt-4o', + : 'gpt-4o-2024-08-06', }), }); diff --git a/apps/frontend/src/components/billing/faq.component.tsx b/apps/frontend/src/components/billing/faq.component.tsx index dc82aa97..34c4026f 100644 --- a/apps/frontend/src/components/billing/faq.component.tsx +++ b/apps/frontend/src/components/billing/faq.component.tsx @@ -4,9 +4,15 @@ import interClass from '@gitroom/react/helpers/inter.font'; import { isGeneral } from '@gitroom/react/helpers/is.general'; const list = [ + { + title: `Can I trust ${isGeneral() ? 'Postiz' : 'Gitroom'}?`, + description: `${isGeneral() ? 'Postiz' : 'Gitroom'} is proudly open-source! We believe in an ethical and transparent culture, meaning Postiz will live forever. You can check the entire code / or use it for your personal use. You can check the open-source repository click here.`, + }, { title: 'What are channels?', - description: `${isGeneral() ? 'Postiz' : 'Gitroom'} allows you to schedule your posts between different channels. + description: `${ + isGeneral() ? 'Postiz' : 'Gitroom' + } allows you to schedule your posts between different channels. A channel is a publishing platform where you can schedule your posts. For example, you can schedule your posts on Twitter, Linkedin, DEV and Hashnode`, }, @@ -35,7 +41,9 @@ export const FAQSection: FC<{ title: string; description: string }> = ( className="bg-sixth p-[24px] border border-tableBorder rounded-[4px] flex flex-col" onClick={changeShow} > -