fix(categories): correct all 7 smart-folder bugs at source (PHASE 2) (#38)
CI / backend (push) Successful in 52s
CI / frontend (push) Successful in 11s
CI / format (push) Successful in 1m8s
CI / db-tests (push) Successful in 49s
Deploy Staging / deploy (push) Successful in 24s
CI / backend (pull_request) Successful in 53s
CI / frontend (pull_request) Successful in 11s
CI / format (pull_request) Successful in 49s
CI / db-tests (pull_request) Successful in 52s
Security / secrets (push) Successful in 3s
Security / dependencies (push) Successful in 58s
Security / sast (push) Successful in 33s
Security / secrets (pull_request) Successful in 3s
Security / dependencies (pull_request) Successful in 58s
Security / sast (pull_request) Successful in 37s
CI / backend (push) Successful in 52s
CI / frontend (push) Successful in 11s
CI / format (push) Successful in 1m8s
CI / db-tests (push) Successful in 49s
Deploy Staging / deploy (push) Successful in 24s
CI / backend (pull_request) Successful in 53s
CI / frontend (pull_request) Successful in 11s
CI / format (pull_request) Successful in 49s
CI / db-tests (pull_request) Successful in 52s
Security / secrets (push) Successful in 3s
Security / dependencies (push) Successful in 58s
Security / sast (push) Successful in 33s
Security / secrets (pull_request) Successful in 3s
Security / dependencies (pull_request) Successful in 58s
Security / sast (pull_request) Successful in 37s
This commit was merged in pull request #38.
This commit is contained in:
@@ -72,6 +72,22 @@ public class EmailController : ApiControllerBase
|
||||
[HttpPost("{id:guid}/untrash")]
|
||||
public Task<IActionResult> Untrash(Guid id, CancellationToken ct) => Act(id, CleanupActionType.Archive, ct);
|
||||
|
||||
/// <summary>Toggle the local-only Read Later marker (no Gmail side effect).</summary>
|
||||
[HttpPost("{id:guid}/readlater")]
|
||||
public Task<IActionResult> ReadLater(Guid id, CancellationToken ct) => SetReadLater(id, true, ct);
|
||||
|
||||
[HttpPost("{id:guid}/unreadlater")]
|
||||
public Task<IActionResult> UnreadLater(Guid id, CancellationToken ct) => SetReadLater(id, false, ct);
|
||||
|
||||
private async Task<IActionResult> SetReadLater(Guid id, bool value, CancellationToken ct)
|
||||
{
|
||||
var email = await _db.Emails.FirstOrDefaultAsync(e => e.Id == id && e.UserId == UserId, ct);
|
||||
if (email is null) return NotFound();
|
||||
email.IsReadLater = value;
|
||||
await _db.SaveChangesAsync(ct);
|
||||
return Ok();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inline unsubscribe. Detects the unsubscribe mechanism for the email's sender,
|
||||
/// then executes it (HTTP one-click or HTTP link). mailto targets cannot be sent
|
||||
|
||||
Reference in New Issue
Block a user