H₂O
H₂O
Explore posts from servers
PPrisma
Created by H₂O on 1/8/2025 in #help-and-questions
"payload" argument must be of type object. Received null
does anyone why this issue occurs when im trying to catch it? its really difficult to debug the issue without any console errors
12 replies
PPrisma
Created by H₂O on 1/8/2025 in #help-and-questions
"payload" argument must be of type object. Received null
i think its something with the address as when i removed it, its working but what the issue is?
12 replies
PPrisma
Created by H₂O on 1/8/2025 in #help-and-questions
"payload" argument must be of type object. Received null
even trying it manually like this:
await prisma.patient.create({
data: {
patientId: safeData.patientId,
firstName: safeData.firstName,
lastName: safeData.lastName,
fullName: safeData.firstName + " " + safeData.lastName,
dateOfBirth: new Date(safeData.dateOfBirth),
gender: safeData.gender,
phoneNumber: safeData.phoneNumber,
workPhoneNumber: safeData.workPhoneNumber ?? "",
homePhoneNumber: safeData.homePhoneNumber ?? "",
additionalPhoneNumber: safeData.additionalPhoneNumber ?? "",
firstVisit: new Date(),
email: safeData.email ?? "",
},
});
await prisma.patient.create({
data: {
patientId: safeData.patientId,
firstName: safeData.firstName,
lastName: safeData.lastName,
fullName: safeData.firstName + " " + safeData.lastName,
dateOfBirth: new Date(safeData.dateOfBirth),
gender: safeData.gender,
phoneNumber: safeData.phoneNumber,
workPhoneNumber: safeData.workPhoneNumber ?? "",
homePhoneNumber: safeData.homePhoneNumber ?? "",
additionalPhoneNumber: safeData.additionalPhoneNumber ?? "",
firstVisit: new Date(),
email: safeData.email ?? "",
},
});
doesnt work.
12 replies
PPrisma
Created by H₂O on 1/8/2025 in #help-and-questions
"payload" argument must be of type object. Received null
{
patientId: '147894561',
firstName: 'testing',
lastName: 'testing',
gender: 'male,
phoneNumber: '1234567891',
dateOfBirth: '2024-12-10',
city: 'testing'
}
{
patientId: '147894561',
firstName: 'testing',
lastName: 'testing',
gender: 'male,
phoneNumber: '1234567891',
dateOfBirth: '2024-12-10',
city: 'testing'
}
12 replies
PPrisma
Created by H₂O on 1/8/2025 in #help-and-questions
"payload" argument must be of type object. Received null
it will just point at the logging line:
TypeError: The "payload" argument must be of type object. Received null
at createPatient (file://C%3A/Users/DaYroXy/dev/smile/app/actions/patients.actions.ts:62:10)
60 | };
61 | } catch (err) {
> 62 | console.error("Error creating patient:", err);
| ^
63 | return {
64 | error: true,
65 | message: "err", {
code: 'ERR_INVALID_ARG_TYPE',
digest: '1928657120'
}
TypeError: The "payload" argument must be of type object. Received null
at createPatient (file://C%3A/Users/DaYroXy/dev/smile/app/actions/patients.actions.ts:62:10)
60 | };
61 | } catch (err) {
> 62 | console.error("Error creating patient:", err);
| ^
63 | return {
64 | error: true,
65 | message: "err", {
code: 'ERR_INVALID_ARG_TYPE',
digest: '1928657120'
}
12 replies
PPrisma
Created by H₂O on 1/8/2025 in #help-and-questions
"payload" argument must be of type object. Received null
data being sent:
{
data: {
patientId: '123456789',
firstName: 'asddsa',
lastName: 'asddsa',
gender: 'male',
phoneNumber: '0547894123',
dateOfBirth: 2024-12-18T00:00:00.000Z,
city: 'akko',
firstVisit: 2025-01-08T17:59:55.054Z
}
}
{
data: {
patientId: '123456789',
firstName: 'asddsa',
lastName: 'asddsa',
gender: 'male',
phoneNumber: '0547894123',
dateOfBirth: 2024-12-18T00:00:00.000Z,
city: 'akko',
firstVisit: 2025-01-08T17:59:55.054Z
}
}
i tried some changes to the schema by removing the uniques:
model Patient {
id Int @id @default(autoincrement())
patientId String @db.VarChar(10)
firstName String
lastName String
fullName String?
dateOfBirth DateTime
gender String
phoneNumber String
workPhoneNumber String?
homePhoneNumber String?
additionalPhoneNumber String?
firstVisit DateTime
email String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
address PatientAddress? @relation("PatientToAddress")

@@map("patient")
}

model PatientAddress {
id Int @id @default(autoincrement())
street String?
city String
zipCode String?
patientId Int @unique
patient Patient @relation("PatientToAddress", fields: [patientId], references: [id], onDelete: Cascade)

@@map("patient_address")
}
model Patient {
id Int @id @default(autoincrement())
patientId String @db.VarChar(10)
firstName String
lastName String
fullName String?
dateOfBirth DateTime
gender String
phoneNumber String
workPhoneNumber String?
homePhoneNumber String?
additionalPhoneNumber String?
firstVisit DateTime
email String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
address PatientAddress? @relation("PatientToAddress")

@@map("patient")
}

model PatientAddress {
id Int @id @default(autoincrement())
street String?
city String
zipCode String?
patientId Int @unique
patient Patient @relation("PatientToAddress", fields: [patientId], references: [id], onDelete: Cascade)

@@map("patient_address")
}
12 replies
PPrisma
Created by H₂O on 1/8/2025 in #help-and-questions
"payload" argument must be of type object. Received null
Hey! thank you for the response im using nextjs 15 with actions here it is:
export const createPatient = async (
data: z.infer<typeof CreatePatientValidation>
): Promise<{ error: boolean; message: string }> => {
try {
const session = await auth.api.getSession({
headers: await headers(),
});

if (!session) {
return { error: true, message: "err" };
}

const safeData = CreatePatientValidation.parse(data);

const idExists = await prisma.patient.findFirst({ where: { patientId: safeData.patientId } });
console.log(idExists);
if (idExists) {
return {
error: true,
message: "err",
};
}

console.log({
data: {
...safeData,
dateOfBirth: new Date(safeData.dateOfBirth),
firstVisit: new Date(),
},
});
await prisma.patient.create({
data: {
...safeData,
dateOfBirth: new Date(safeData.dateOfBirth),
firstVisit: new Date(),
},
});

revalidatePath("/patients");
return {
error: false,
message: "err",
};
} catch (err) {
return {
error: true,
message: "err",
};
}
};
export const createPatient = async (
data: z.infer<typeof CreatePatientValidation>
): Promise<{ error: boolean; message: string }> => {
try {
const session = await auth.api.getSession({
headers: await headers(),
});

if (!session) {
return { error: true, message: "err" };
}

const safeData = CreatePatientValidation.parse(data);

const idExists = await prisma.patient.findFirst({ where: { patientId: safeData.patientId } });
console.log(idExists);
if (idExists) {
return {
error: true,
message: "err",
};
}

console.log({
data: {
...safeData,
dateOfBirth: new Date(safeData.dateOfBirth),
firstVisit: new Date(),
},
});
await prisma.patient.create({
data: {
...safeData,
dateOfBirth: new Date(safeData.dateOfBirth),
firstVisit: new Date(),
},
});

revalidatePath("/patients");
return {
error: false,
message: "err",
};
} catch (err) {
return {
error: true,
message: "err",
};
}
};
12 replies
HHomarr
Created by H₂O on 3/10/2024 in #💬・get-help
No supported torrent, even tho qbit is integrated
Never knew that was a thing! now it works 🙂 was a simple CSRF issue thank you
19 replies
HHomarr
Created by H₂O on 3/10/2024 in #💬・get-help
No supported torrent, even tho qbit is integrated
# wget --spider -S http://172.25.0.2:8080
Spider mode enabled. Check if remote file exists.
--2024-03-10 08:47:04-- http://172.25.0.2:8080/
Connecting to 172.25.0.2:8080... connected.
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
cache-control: no-store
connection: keep-alive
content-length: 1671
content-security-policy: default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; script-src 'self' 'unsafe-inline'; object-src 'none'; form-action 'self'; frame-ancestors 'self';
content-type: text/html
cross-origin-opener-policy: same-origin
date: Sun, 10 Mar 2024 08:47:04 GMT
referrer-policy: same-origin
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
Length: 1671 (1.6K) [text/html]
Remote file exists and could contain further links,
but recursion is disabled -- not retrieving.
# wget --spider -S http://172.25.0.2:8080
Spider mode enabled. Check if remote file exists.
--2024-03-10 08:47:04-- http://172.25.0.2:8080/
Connecting to 172.25.0.2:8080... connected.
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
cache-control: no-store
connection: keep-alive
content-length: 1671
content-security-policy: default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; script-src 'self' 'unsafe-inline'; object-src 'none'; form-action 'self'; frame-ancestors 'self';
content-type: text/html
cross-origin-opener-policy: same-origin
date: Sun, 10 Mar 2024 08:47:04 GMT
referrer-policy: same-origin
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
Length: 1671 (1.6K) [text/html]
Remote file exists and could contain further links,
but recursion is disabled -- not retrieving.
that from the homarr container
19 replies
HHomarr
Created by H₂O on 3/10/2024 in #💬・get-help
No supported torrent, even tho qbit is integrated
its already off by default i didn't but in the headers there are no csrf
19 replies
HHomarr
Created by H₂O on 3/10/2024 in #💬・get-help
No supported torrent, even tho qbit is integrated
if you mean in homarr it self i did and tried no luck, also i tried using wget 172.25.0.2:8080 from homarr shell and i got the login html fine too
19 replies
HHomarr
Created by H₂O on 3/10/2024 in #💬・get-help
No supported torrent, even tho qbit is integrated
password is correct, i changed it now to double check also qbit doesnt use csrf i think here are the headers
HTTP/1.1 200 OK
Server: openresty
Date: Sun, 10 Mar 2024 08:40:07 GMT
Content-Type: text/html
Content-Length: 3594
Connection: keep-alive
cache-control: no-store
content-encoding: gzip
content-security-policy: default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; script-src 'self' 'unsafe-inline'; object-src 'none'; form-action 'self'; frame-ancestors 'self';
cross-origin-opener-policy: same-origin
referrer-policy: same-origin
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
X-Served-By: qbittorrent.lan
HTTP/1.1 200 OK
Server: openresty
Date: Sun, 10 Mar 2024 08:40:07 GMT
Content-Type: text/html
Content-Length: 3594
Connection: keep-alive
cache-control: no-store
content-encoding: gzip
content-security-policy: default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; script-src 'self' 'unsafe-inline'; object-src 'none'; form-action 'self'; frame-ancestors 'self';
cross-origin-opener-policy: same-origin
referrer-policy: same-origin
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
X-Served-By: qbittorrent.lan
19 replies
HHomarr
Created by H₂O on 3/10/2024 in #💬・get-help
No supported torrent, even tho qbit is integrated
i think that should be all?
19 replies
HHomarr
Created by H₂O on 3/10/2024 in #💬・get-help
No supported torrent, even tho qbit is integrated
19 replies
HHomarr
Created by H₂O on 3/10/2024 in #💬・get-help
No supported torrent, even tho qbit is integrated
No description
19 replies
HHomarr
Created by H₂O on 3/10/2024 in #💬・get-help
No supported torrent, even tho qbit is integrated
No description
19 replies
HHomarr
Created by H₂O on 3/10/2024 in #💬・get-help
No supported torrent, even tho qbit is integrated
No description
19 replies