mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-29 19:35:20 +02:00
update seach source connector schema
This commit is contained in:
parent
9abaf4fd2a
commit
f96afe0e2a
3 changed files with 22 additions and 26 deletions
|
|
@ -5,6 +5,7 @@ from typing import Any
|
|||
from pydantic import BaseModel, ConfigDict, field_validator
|
||||
|
||||
from app.db import SearchSourceConnectorType
|
||||
from app.schemas.google_auth_credentials import GoogleAuthCredentialsBase
|
||||
|
||||
from .base import IDModel, TimestampModel
|
||||
|
||||
|
|
@ -179,6 +180,14 @@ class SearchSourceConnectorBase(BaseModel):
|
|||
if not config.get("CLICKUP_API_TOKEN"):
|
||||
raise ValueError("CLICKUP_API_TOKEN cannot be empty")
|
||||
|
||||
elif connector_type == SearchSourceConnectorType.GOOGLE_CALENDAR_CONNECTOR:
|
||||
# Required fields
|
||||
required_keys = list(GoogleAuthCredentialsBase.model_fields.keys())
|
||||
|
||||
for key in required_keys:
|
||||
if key not in config or config[key] in (None, ""):
|
||||
raise ValueError(f"{key} is required and cannot be empty")
|
||||
|
||||
return config
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue