mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 09:18:53 +00:00
fix(esx_identity): DOB validation
This commit is contained in:
+7
-7
File diff suppressed because one or more lines are too long
Vendored
+2
-2
@@ -11,11 +11,11 @@
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css"
|
||||
integrity="sha512-Kc323vGBEqzTmouAECnVceyQqyqdsSiqLQISBL29aUW4U/M7pSPA/gEUZQqv1cwx4OnYxTxve5UMg5GT6L4JJg=="
|
||||
crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
<script type="module" crossorigin src="./assets/index-CQllZdg3.js"></script>
|
||||
<script type="module" crossorigin src="./assets/index-DJTiCb6I.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="./assets/index-CBKwBtku.css">
|
||||
</head>
|
||||
|
||||
<body class="nonde">
|
||||
<body class="none">
|
||||
<div id="app"></div>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -243,6 +243,8 @@ end
|
||||
|
||||
ESX.RegisterServerCallback("esx_identity:registerIdentity", function(source, cb, data)
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
data.dateofbirth = formatDate(data.dateofbirth)
|
||||
|
||||
if not checkNameFormat(data.firstname) then
|
||||
TriggerClientEvent("esx:showNotification", source, TranslateCap("invalid_firstname_format"), "error")
|
||||
return cb(false)
|
||||
@@ -272,7 +274,7 @@ end
|
||||
playerIdentity[xPlayer.identifier] = {
|
||||
firstName = formatName(data.firstname),
|
||||
lastName = formatName(data.lastname),
|
||||
dateOfBirth = formatDate(data.dateofbirth),
|
||||
dateOfBirth = data.dateofbirth,
|
||||
sex = data.sex,
|
||||
height = data.height,
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ const onSubmit = (values) => {
|
||||
body: JSON.stringify({
|
||||
firstname: values.firstname,
|
||||
lastname: values.lastname,
|
||||
dateofbirth: values.dob,
|
||||
dateofbirth: moment(values.dob).format("DD/MM/YYYY"),
|
||||
sex: values.gender,
|
||||
height: values.height,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user