mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-27 13:17:51 +02:00
✨ Add instance settings and option to disable user registration (#1745)
This commit is contained in:
parent
9e1f3c616e
commit
3c2e008579
31 changed files with 552 additions and 153 deletions
18
apps/web/src/features/instance-settings/queries.ts
Normal file
18
apps/web/src/features/instance-settings/queries.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
"server-only";
|
||||
import { prisma } from "@rallly/database";
|
||||
import { cache } from "react";
|
||||
|
||||
export const getInstanceSettings = cache(async () => {
|
||||
const instanceSettings = await prisma.instanceSettings.findUnique({
|
||||
where: {
|
||||
id: 1,
|
||||
},
|
||||
select: {
|
||||
disableUserRegistration: true,
|
||||
},
|
||||
});
|
||||
|
||||
return {
|
||||
disableUserRegistration: instanceSettings?.disableUserRegistration ?? false,
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue