feat: get, add, & delete user's inbox api tokens (#50)

* feat: get, add, & delete user's inbox api tokens

* inbox: generate inbox api key on the server

* inbox: use nanoid to generate api key && set created date on server

* inbox: set api key in constructor && increase default expiry date to 1 year
This commit is contained in:
01zulfi
2025-09-16 08:40:52 +05:00
committed by GitHub
parent 4a0aee1c44
commit 9b774d640c
9 changed files with 207 additions and 5 deletions
@@ -84,6 +84,11 @@ namespace Streetwriters.Data.Repositories
return all.ToList();
}
public virtual async Task<long> CountAsync(Expression<Func<TEntity, bool>> filterExpression)
{
return await Collection.CountDocumentsAsync(filterExpression);
}
public virtual void Update(string id, TEntity obj)
{
dbContext.AddCommand((handle, ct) => Collection.ReplaceOneAsync(handle, Builders<TEntity>.Filter.Eq("_id", ObjectId.Parse(id)), obj, cancellationToken: ct));