Compare commits

..

1 Commits

Author SHA1 Message Date
e9566dcc62 dev (#1)
All checks were successful
Build Urlshort / publish (push) Successful in 1m29s
Reviewed-on: #1
Co-authored-by: fede <federico.nicolas.polidoro@gmail.com>
Co-committed-by: fede <federico.nicolas.polidoro@gmail.com>
2026-03-18 16:33:48 -03:00
3 changed files with 4 additions and 4 deletions

View File

@@ -10,7 +10,7 @@
href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap"
rel="stylesheet"
/>
<title>Acortador de Urls</title>
<title>front</title>
</head>
<body>
<div id="app"></div>

View File

@@ -13,7 +13,7 @@
onsubmit={async (e) => {
e.preventDefault();
// console.log(e.target[0].value);
// console.log($url);
console.log($url);
const req = { longUrl: input.value };
try {
const res = await fetch(`${$url}/url/`, {
@@ -22,7 +22,7 @@
});
if (res.ok) {
const data = await res.json();
// console.log(data.shortUrl);
console.log(data.shortUrl);
popup = data.shortUrl;
}
} catch {

View File

@@ -40,7 +40,7 @@ func CrearUrl(longURL string, db *gorm.DB) (string, error) {
var url models.Url
for {
url.Shorturl = int64(rand.Uint64())
url.Shorturl = rand.Int64()
result = db.Model(&models.Url{}).Where("shorturl = ?", url.Shorturl).Count(&counturl)
if result.Error != nil {
return "", result.Error