feat(controller): add endpoint to retrieve last used receiver name by email

- Implemented `Get` endpoint in `EnvelopeReceiverController` to fetch the last used receiver's name by email.
- Added handling for successful and failed responses, including proper status codes and logging.
This commit is contained in:
Developer 02
2024-08-29 17:15:00 +02:00
parent 1ededc1f64
commit 8831436809
2 changed files with 26 additions and 3 deletions

View File

@@ -78,7 +78,7 @@ namespace EnvelopeGenerator.Infrastructure.Repositories
public async Task<EnvelopeReceiver?> ReadLastByReceiver(string email)
{
return await _dbSet.Where(er => er.Receiver!.EmailAddress == email).LastOrDefaultAsync();
return await _dbSet.Where(er => er.Receiver!.EmailAddress == email).OrderBy(er => er.EnvelopeId).LastOrDefaultAsync();
}
}
}