fix: actually unverify when editing

This commit is contained in:
2024-05-19 16:50:32 +02:00
parent 2163407080
commit ca378f6eeb
2 changed files with 5 additions and 3 deletions

View File

@@ -76,7 +76,7 @@ export default function BotForm(props: Props) {
<AlertTitle>Warning</AlertTitle>
<AlertDescription className="whitespace-pre-line">
When resubmitting, the bot will be unverified until the devteam verifies it again.{'\n'}
This doesn't apply when it's just regenerating the profile picture
This doesn't apply when regenerating the profile picture
</AlertDescription>
</Alert>
</div>

View File

@@ -28,7 +28,10 @@ export async function submitBotData(prev: any, formData: FormData): Promise<Defa
where: {
id: parsedData.data.id,
},
data: parsedData.data,
data: {
verified: false,
...parsedData.data,
},
});
} else {
const { name, botId, inviteLink, srcLink, description } = parsedData.data;
@@ -74,7 +77,6 @@ export async function handleBotVerificationSwitch(data: { id: string, verified:
error: `From ${parsedData.error.errors[0].path[0]}: ${parsedData.error.errors[0].message}`,
};
}
console.log(parsedData.data.id, parsedData.data.verified)
const botUpdate = await prisma.bot.update({
where: {