feat: suporte a múltiplos sellerId e melhorias no código
- Adicionado suporte para sellerId como string separada por vírgula (ex: 270,431) - Melhorias em deb.repository: tipagem e documentação - Melhorias em deb.service: remoção de validação redundante - Melhorias em deb.controller: remoção de try/catch duplicado - Melhorias em orders.service: early returns e tipagem melhorada - Aplicado early returns para reduzir aninhamento - Melhorias de tipagem em todos os métodos
This commit is contained in:
@@ -11,7 +11,14 @@ export class RedisClientAdapter implements IRedisClient {
|
||||
|
||||
async get<T>(key: string): Promise<T | null> {
|
||||
const data = await this.redis.get(key);
|
||||
return data ? JSON.parse(data) : null;
|
||||
if (!data) return null;
|
||||
|
||||
try {
|
||||
return JSON.parse(data);
|
||||
} catch (error) {
|
||||
// If it's not valid JSON, return the raw string value
|
||||
return data as T;
|
||||
}
|
||||
}
|
||||
|
||||
async set<T>(key: string, value: T, ttlSeconds = 300): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user