fix: paginas de teste
All checks were successful
BCards Deployment Pipeline / Run Tests (push) Successful in 2s
BCards Deployment Pipeline / PR Validation (push) Has been skipped
BCards Deployment Pipeline / Build and Push Image (push) Successful in 15m7s
BCards Deployment Pipeline / Deploy to Production (ARM - OCI) (push) Successful in 2m0s
BCards Deployment Pipeline / Deploy to Test (x86 - Local) (push) Has been skipped
BCards Deployment Pipeline / Cleanup Old Resources (push) Has been skipped
BCards Deployment Pipeline / Deployment Summary (push) Successful in 0s

This commit is contained in:
Ricardo Carneiro 2025-09-18 18:21:51 -03:00
parent 1d80b48a81
commit 28777d8437
2 changed files with 20 additions and 9 deletions

View File

@ -94,9 +94,11 @@ public class UserPage : IPageDisplay
// Exclusão lógica
[BsonElement("deletedAt")]
[BsonIgnoreIfDefault]
public DateTime? DeletedAt { get; set; }
[BsonElement("deletionReason")]
[BsonIgnoreIfDefault]
public string? DeletionReason { get; set; } // "trial_expired", "user_requested", "moderation_violation"
[BsonIgnore]

View File

@ -217,15 +217,24 @@
@section Scripts {
<script>
function recordClick(pageId, linkIndex) {
fetch('/click/' + pageId, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ linkIndex: linkIndex })
}).catch(function(error) {
console.log('Error recording click:', error);
});
// Detectar se é LivePage ou UserPage
var isLivePage = @Json.Serialize(isLivePage);
if (isLivePage) {
// LivePages não registram cliques via fetch - usam redirecionamento direto
return;
} else {
// UserPages registram cliques via API
fetch('/page/click/' + pageId, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ linkIndex: linkIndex })
}).catch(function(error) {
console.log('Error recording click:', error);
});
}
}
function toggleLinkDetails(linkIndex) {