Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const HandleServers = ({ serverId }: Props) => {
await mutateAsync({
name: data.name,
description: data.description || "",
ipAddress: data.ipAddress || "",
ipAddress: data.ipAddress?.trim() || "",
port: data.port || 22,
username: data.username || "root",
sshKeyId: data.sshKeyId || "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const CreateServer = ({ stepper }: Props) => {
await mutateAsync({
name: data.name,
description: data.description || "",
ipAddress: data.ipAddress || "",
ipAddress: data.ipAddress?.trim() || "",
port: data.port || 22,
username: data.username || "root",
sshKeyId: data.sshKeyId || "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { toast } from "sonner";
import { z } from "zod";

const schema = z.object({
serverIp: z.string(),
serverIp: z.string().trim(),
});

type Schema = z.infer<typeof schema>;
Expand Down Expand Up @@ -76,7 +76,7 @@ export const UpdateServerIp = ({ children }: Props) => {

const onSubmit = async (data: Schema) => {
await mutateAsync({
serverIp: data.serverIp,
serverIp: data.serverIp.trim(),
})
.then(async () => {
toast.success("Server IP Updated");
Expand Down
1 change: 1 addition & 0 deletions packages/server/src/db/schema/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ const createSchema = createInsertSchema(server, {
serverId: z.string().min(1),
name: z.string().min(1),
description: z.string().optional(),
ipAddress: z.string().trim(),
});

export const apiCreateServer = createSchema
Expand Down