kopia lustrzana https://github.com/bugout-dev/moonstream
Add fix.
rodzic
767921a67f
commit
22d0bfe083
|
@ -7,7 +7,7 @@ from typing import Any, Dict, List, Optional, Union, Literal
|
|||
from uuid import UUID
|
||||
from xmlrpc.client import Boolean
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from pydantic import BaseModel, Field, validator
|
||||
from sqlalchemy import false
|
||||
|
||||
USER_ONBOARDING_STATE = "onboarding_state"
|
||||
|
@ -295,8 +295,9 @@ class QueryInfoResponse(BaseModel):
|
|||
preapprove: bool = False
|
||||
approved: bool = False
|
||||
parameters: Dict[str, Any] = Field(default_factory=dict)
|
||||
created_at: str
|
||||
updated_at: str
|
||||
created_at: Optional[datetime] = None
|
||||
updated_at: Optional[datetime] = None
|
||||
|
||||
|
||||
class SuggestedQueriesResponse(BaseModel):
|
||||
interfaces: Dict[str, Any] = Field(default_factory=dict)
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
"""
|
||||
The Moonstream queries HTTP API
|
||||
"""
|
||||
from datetime import datetime
|
||||
import logging
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
from uuid import UUID
|
||||
|
||||
|
||||
|
||||
from bugout.data import BugoutResources, BugoutJournalEntryContent, BugoutJournalEntry
|
||||
from bugout.exceptions import BugoutResponseException
|
||||
from fastapi import APIRouter, Body, Request
|
||||
|
@ -310,14 +312,17 @@ async def get_query_handler(
|
|||
else:
|
||||
query_parameters[param] = None
|
||||
|
||||
|
||||
print(type(entry.created_at))
|
||||
|
||||
return data.QueryInfoResponse(
|
||||
query=entry.content,
|
||||
query_id=str(query_id),
|
||||
preapprove="preapprove" in tags_dict,
|
||||
approved="approved" in tags_dict,
|
||||
parameters=query_parameters,
|
||||
created_at=entry.created_at,
|
||||
updated_at=entry.updated_at,
|
||||
created_at=entry.created_at, # type: ignore
|
||||
updated_at=entry.updated_at, # type: ignore
|
||||
)
|
||||
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue