mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +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"
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css"
|
||||||
integrity="sha512-Kc323vGBEqzTmouAECnVceyQqyqdsSiqLQISBL29aUW4U/M7pSPA/gEUZQqv1cwx4OnYxTxve5UMg5GT6L4JJg=="
|
integrity="sha512-Kc323vGBEqzTmouAECnVceyQqyqdsSiqLQISBL29aUW4U/M7pSPA/gEUZQqv1cwx4OnYxTxve5UMg5GT6L4JJg=="
|
||||||
crossorigin="anonymous" referrerpolicy="no-referrer" />
|
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">
|
<link rel="stylesheet" crossorigin href="./assets/index-CBKwBtku.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="nonde">
|
<body class="none">
|
||||||
<div id="app"></div>␍
|
<div id="app"></div>␍
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|||||||
@@ -243,6 +243,8 @@ end
|
|||||||
|
|
||||||
ESX.RegisterServerCallback("esx_identity:registerIdentity", function(source, cb, data)
|
ESX.RegisterServerCallback("esx_identity:registerIdentity", function(source, cb, data)
|
||||||
local xPlayer = ESX.GetPlayerFromId(source)
|
local xPlayer = ESX.GetPlayerFromId(source)
|
||||||
|
data.dateofbirth = formatDate(data.dateofbirth)
|
||||||
|
|
||||||
if not checkNameFormat(data.firstname) then
|
if not checkNameFormat(data.firstname) then
|
||||||
TriggerClientEvent("esx:showNotification", source, TranslateCap("invalid_firstname_format"), "error")
|
TriggerClientEvent("esx:showNotification", source, TranslateCap("invalid_firstname_format"), "error")
|
||||||
return cb(false)
|
return cb(false)
|
||||||
@@ -272,7 +274,7 @@ end
|
|||||||
playerIdentity[xPlayer.identifier] = {
|
playerIdentity[xPlayer.identifier] = {
|
||||||
firstName = formatName(data.firstname),
|
firstName = formatName(data.firstname),
|
||||||
lastName = formatName(data.lastname),
|
lastName = formatName(data.lastname),
|
||||||
dateOfBirth = formatDate(data.dateofbirth),
|
dateOfBirth = data.dateofbirth,
|
||||||
sex = data.sex,
|
sex = data.sex,
|
||||||
height = data.height,
|
height = data.height,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const onSubmit = (values) => {
|
|||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
firstname: values.firstname,
|
firstname: values.firstname,
|
||||||
lastname: values.lastname,
|
lastname: values.lastname,
|
||||||
dateofbirth: values.dob,
|
dateofbirth: moment(values.dob).format("DD/MM/YYYY"),
|
||||||
sex: values.gender,
|
sex: values.gender,
|
||||||
height: values.height,
|
height: values.height,
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user