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 // Exclusão lógica
[BsonElement("deletedAt")] [BsonElement("deletedAt")]
[BsonIgnoreIfDefault]
public DateTime? DeletedAt { get; set; } public DateTime? DeletedAt { get; set; }
[BsonElement("deletionReason")] [BsonElement("deletionReason")]
[BsonIgnoreIfDefault]
public string? DeletionReason { get; set; } // "trial_expired", "user_requested", "moderation_violation" public string? DeletionReason { get; set; } // "trial_expired", "user_requested", "moderation_violation"
[BsonIgnore] [BsonIgnore]

View File

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