Skip to content

Commit

Permalink
🔨 fix minor bugs
Browse files Browse the repository at this point in the history
closes #101
closes #102
  • Loading branch information
casperiv0 committed Nov 2, 2021
1 parent bdbe194 commit 397c302
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion packages/api/src/controllers/admin/Values.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,18 @@ export class ValuesController {

if (data) {
// @ts-expect-error ignore
await prisma[data.name].delete({
const deleted = await prisma[data.name].delete({
where: {
id,
},
});

await prisma.value.delete({
where: {
id: deleted.valueId,
},
});

return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ export const ManageValueModal = ({ onCreate, onUpdate, clType: dlType, type, val
/>
</FormField>

<FormField fieldId="color" label="Color">
<FormField fieldId="color" label="Color (#HEX)">
<Input name="color" onChange={handleChange} value={values.color} />
<Error>{errors.color}</Error>
</FormField>
Expand Down
2 changes: 1 addition & 1 deletion packages/schemas/src/admin/values.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { z } from "zod";

export const VALUE_SCHEMA = z.object({
value: z.string().min(2).max(255),
value: z.string().min(1).max(255),
});

export const CREATE_PENAL_CODE_SCHEMA = z.object({
Expand Down

0 comments on commit 397c302

Please sign in to comment.