Prettier format pending files
This commit is contained in:
parent
3904126a40
commit
5eab5f53e6
6 changed files with 28 additions and 14 deletions
|
|
@ -8,7 +8,7 @@ const GITBOOK_SPACE_ID = process.env.GITBOOK_SPACE_ID;
|
||||||
// Validate environment variables
|
// Validate environment variables
|
||||||
if (!GITBOOK_API_TOKEN || !GITBOOK_SPACE_ID) {
|
if (!GITBOOK_API_TOKEN || !GITBOOK_SPACE_ID) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"Missing required environment variables: GITBOOK_API_TOKEN and GITBOOK_SPACE_ID"
|
"Missing required environment variables: GITBOOK_API_TOKEN and GITBOOK_SPACE_ID",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -219,14 +219,20 @@ export function AdminDiscordManagement() {
|
||||||
placeholder="Discord Server ID"
|
placeholder="Discord Server ID"
|
||||||
value={newMapping.server_id}
|
value={newMapping.server_id}
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
setNewMapping({ ...newMapping, server_id: e.target.value })
|
setNewMapping({
|
||||||
|
...newMapping,
|
||||||
|
server_id: e.target.value,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
className="w-full mt-1 bg-gray-800 border border-purple-500/30 rounded px-3 py-2 text-white focus:outline-none focus:border-purple-500"
|
className="w-full mt-1 bg-gray-800 border border-purple-500/30 rounded px-3 py-2 text-white focus:outline-none focus:border-purple-500"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Button type="submit" className="w-full bg-purple-600 hover:bg-purple-700">
|
<Button
|
||||||
|
type="submit"
|
||||||
|
className="w-full bg-purple-600 hover:bg-purple-700"
|
||||||
|
>
|
||||||
Add Mapping
|
Add Mapping
|
||||||
</Button>
|
</Button>
|
||||||
</form>
|
</form>
|
||||||
|
|
@ -295,13 +301,16 @@ export function AdminDiscordManagement() {
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
{/* Delete Confirmation */}
|
{/* Delete Confirmation */}
|
||||||
<AlertDialog open={!!deleteId} onOpenChange={(open) => !open && setDeleteId(null)}>
|
<AlertDialog
|
||||||
|
open={!!deleteId}
|
||||||
|
onOpenChange={(open) => !open && setDeleteId(null)}
|
||||||
|
>
|
||||||
<AlertDialogContent>
|
<AlertDialogContent>
|
||||||
<AlertDialogHeader>
|
<AlertDialogHeader>
|
||||||
<AlertDialogTitle>Delete Role Mapping?</AlertDialogTitle>
|
<AlertDialogTitle>Delete Role Mapping?</AlertDialogTitle>
|
||||||
<AlertDialogDescription>
|
<AlertDialogDescription>
|
||||||
This role mapping will be permanently deleted. Users will no longer
|
This role mapping will be permanently deleted. Users will no
|
||||||
receive this role when setting this arm.
|
longer receive this role when setting this arm.
|
||||||
</AlertDialogDescription>
|
</AlertDialogDescription>
|
||||||
</AlertDialogHeader>
|
</AlertDialogHeader>
|
||||||
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ export default function Admin() {
|
||||||
}, [user, loading, navigate]);
|
}, [user, loading, navigate]);
|
||||||
|
|
||||||
const [managedProfiles, setManagedProfiles] = useState<AethexUserProfile[]>(
|
const [managedProfiles, setManagedProfiles] = useState<AethexUserProfile[]>(
|
||||||
[]
|
[],
|
||||||
);
|
);
|
||||||
const [studios, setStudios] = useState<Studio[]>([
|
const [studios, setStudios] = useState<Studio[]>([
|
||||||
{
|
{
|
||||||
|
|
@ -161,7 +161,7 @@ export default function Admin() {
|
||||||
setProjectApplicationsLoading(true);
|
setProjectApplicationsLoading(true);
|
||||||
try {
|
try {
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
`/api/applications?owner=${encodeURIComponent(user.id)}`
|
`/api/applications?owner=${encodeURIComponent(user.id)}`,
|
||||||
);
|
);
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
|
|
@ -187,7 +187,7 @@ export default function Admin() {
|
||||||
setOpportunityApplicationsLoading(true);
|
setOpportunityApplicationsLoading(true);
|
||||||
try {
|
try {
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
`/api/opportunities/applications?email=${encodeURIComponent(email)}`
|
`/api/opportunities/applications?email=${encodeURIComponent(email)}`,
|
||||||
);
|
);
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
|
|
@ -280,7 +280,7 @@ export default function Admin() {
|
||||||
() =>
|
() =>
|
||||||
managedProfiles.find((profile) => profile.id === selectedMemberId) ??
|
managedProfiles.find((profile) => profile.id === selectedMemberId) ??
|
||||||
null,
|
null,
|
||||||
[managedProfiles, selectedMemberId]
|
[managedProfiles, selectedMemberId],
|
||||||
);
|
);
|
||||||
|
|
||||||
const totalMembers = managedProfiles.length;
|
const totalMembers = managedProfiles.length;
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@ NODE_ENV=production
|
||||||
```
|
```
|
||||||
|
|
||||||
**Note:** Get these values from:
|
**Note:** Get these values from:
|
||||||
|
|
||||||
- Discord Developer Portal: Applications → Your Bot → Token & General Information
|
- Discord Developer Portal: Applications → Your Bot → Token & General Information
|
||||||
- Supabase Dashboard: Project Settings → API
|
- Supabase Dashboard: Project Settings → API
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ const missingVars = requiredEnvVars.filter((envVar) => !process.env[envVar]);
|
||||||
if (missingVars.length > 0) {
|
if (missingVars.length > 0) {
|
||||||
console.error(
|
console.error(
|
||||||
"❌ FATAL ERROR: Missing required environment variables:",
|
"❌ FATAL ERROR: Missing required environment variables:",
|
||||||
missingVars.join(", ")
|
missingVars.join(", "),
|
||||||
);
|
);
|
||||||
console.error("\nPlease set these in your Discloud/hosting environment:");
|
console.error("\nPlease set these in your Discloud/hosting environment:");
|
||||||
missingVars.forEach((envVar) => {
|
missingVars.forEach((envVar) => {
|
||||||
|
|
@ -128,7 +128,7 @@ async function registerCommands() {
|
||||||
// Handle Entry Point command conflict (Discord Activity)
|
// Handle Entry Point command conflict (Discord Activity)
|
||||||
if (error.code === 50240) {
|
if (error.code === 50240) {
|
||||||
console.warn(
|
console.warn(
|
||||||
"⚠️ Entry Point command detected (Discord Activity). Attempting to register without bulk update..."
|
"⚠️ Entry Point command detected (Discord Activity). Attempting to register without bulk update...",
|
||||||
);
|
);
|
||||||
// Post commands individually to avoid bulk update conflicts
|
// Post commands individually to avoid bulk update conflicts
|
||||||
for (const command of commands) {
|
for (const command of commands) {
|
||||||
|
|
@ -137,7 +137,9 @@ async function registerCommands() {
|
||||||
{ body: command },
|
{ body: command },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
console.log(`✅ Successfully registered ${commands.length} slash commands (individual).`);
|
console.log(
|
||||||
|
`✅ Successfully registered ${commands.length} slash commands (individual).`,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,9 @@ async function assignRoleByArm(guild, discordId, arm, supabase) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mapping) {
|
if (!mapping) {
|
||||||
console.warn(`No role mapping found for arm: ${arm} in server: ${guild.id}`);
|
console.warn(
|
||||||
|
`No role mapping found for arm: ${arm} in server: ${guild.id}`,
|
||||||
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue