type quote stream

This commit is contained in:
tk 2025-08-16 17:18:01 +02:00
parent 8967b1698e
commit 642dddaaa3

View file

@ -54,7 +54,6 @@ class QuoteEndpoint extends Endpoint {
throw Exception('Quote not found');
}
// Only for dev
Future<List<Quote>> getAllQuotes(Session session) async {
final quotes = await Quote.db.find(session);
return quotes;
@ -66,7 +65,7 @@ class QuoteEndpoint extends Endpoint {
}) async* {
if (limit <= 0 || limit > 500) limit = 200;
final quoteStream = session.messages.createStream('quotes');
final quoteStream = session.messages.createStream<Quote>('quotes');
await for (final Quote quote in quoteStream) {
yield quote;