Rolling back prod

This commit is contained in:
James Ketr 2025-05-28 16:31:05 -07:00
parent 68a4ccb6d3
commit 474bbbed52
6 changed files with 29 additions and 24 deletions

View File

@ -95,7 +95,7 @@ services:
ports: ports:
- "8081:8081" - "8081:8081"
environment: environment:
- REDIS_HOSTS=local:redis:6379 - REDIS_HOSTS=redis:6379
networks: networks:
- internal - internal
depends_on: depends_on:

View File

@ -13,7 +13,7 @@ import { CreateProfilePage } from 'pages/CreateProfilePage';
import { VectorVisualizerPage } from 'pages/VectorVisualizerPage'; import { VectorVisualizerPage } from 'pages/VectorVisualizerPage';
import { HomePage } from 'pages/HomePage'; import { HomePage } from 'pages/HomePage';
import { BetaPage } from 'pages/BetaPage'; import { BetaPage } from 'pages/BetaPage';
import { CandidateListingPage } from 'pages/CandidateListingPage'; import { CandidateListingPage } from 'pages/FindCandidatePage';
import { JobAnalysisPage } from 'pages/JobAnalysisPage'; import { JobAnalysisPage } from 'pages/JobAnalysisPage';
import { GenerateCandidate } from "pages/GenerateCandidate"; import { GenerateCandidate } from "pages/GenerateCandidate";
import { ControlsPage } from 'pages/ControlsPage'; import { ControlsPage } from 'pages/ControlsPage';

View File

@ -271,14 +271,15 @@ const DocsPage = (props: BackstoryPageProps) => {
} }
// Document grid for landing page // Document grid for landing page
return ( return (
<Paper sx={{ p: 5, border: "3px solid orange" }} elevation={1}> <Paper sx={{ p: 1 }} elevation={0}>
<Box sx={{ mb: 2 }}>
<Typography variant="h4" component="h1" gutterBottom> <Typography variant="h4" component="h1" gutterBottom>
Documentation Documentation
</Typography> </Typography>
<Typography variant="body1" color="text.secondary" paragraph> <Typography variant="body1" color="text.secondary">
Select a document from the sidebar to view detailed technical information about the application. Select a document from the sidebar to view detailed technical information about the application.
</Typography> </Typography>
</Box>
<Grid container spacing={1}> <Grid container spacing={1}>
{documents.map((doc, index) => { {documents.map((doc, index) => {
if (doc.route === null) return (<></>); if (doc.route === null) return (<></>);

View File

@ -7,26 +7,21 @@ import { BackstoryPageProps } from '../components/BackstoryTab';
import { CandidateInfo } from 'components/CandidateInfo'; import { CandidateInfo } from 'components/CandidateInfo';
import { connectionBase } from '../utils/Global'; import { connectionBase } from '../utils/Global';
import { Candidate } from "../types/types"; import { Candidate } from "../types/types";
import { ApiClient } from 'types/api-client';
const CandidateListingPage = (props: BackstoryPageProps) => { const CandidateListingPage = (props: BackstoryPageProps) => {
const apiClient = new ApiClient();
const navigate = useNavigate(); const navigate = useNavigate();
const { setSnack } = props; const { setSnack } = props;
const [candidates, setCandidates] = useState<Candidate[] | undefined>(undefined); const [candidates, setCandidates] = useState<Candidate[] | null>(null);
useEffect(() => { useEffect(() => {
if (candidates !== undefined) { if (candidates !== null) {
return; return;
} }
const fetchCandidates = async () => { const getCandidates = async () => {
try { try {
let response; const results = await apiClient.getCandidates();
response = await fetch(`${connectionBase}/api/u`, { const candidates: Candidate[] = results.data;
credentials: 'include',
});
if (!response.ok) {
throw new Error('Session not found');
}
const candidates: Candidate[] = await response.json();
candidates.sort((a, b) => { candidates.sort((a, b) => {
let result = a.lastName.localeCompare(b.lastName); let result = a.lastName.localeCompare(b.lastName);
if (result === 0) { if (result === 0) {
@ -44,7 +39,7 @@ const CandidateListingPage = (props: BackstoryPageProps) => {
} }
}; };
fetchCandidates(); getCandidates();
}, [candidates, setSnack]); }, [candidates, setSnack]);
return ( return (

View File

@ -12,7 +12,7 @@ from typing import Any, Dict, List, Optional, Union, get_origin, get_args
from datetime import datetime from datetime import datetime
from enum import Enum from enum import Enum
from pathlib import Path from pathlib import Path
import stat
def run_command(command: str, description: str, cwd: str | None = None) -> bool: def run_command(command: str, description: str, cwd: str | None = None) -> bool:
"""Run a command and return success status""" """Run a command and return success status"""
try: try:
@ -431,6 +431,8 @@ Examples:
# Step 4: Write to output file # Step 4: Write to output file
with open(args.output, 'w') as f: with open(args.output, 'w') as f:
f.write(ts_content) f.write(ts_content)
# Set read-only permissions (owner can read, others can read)
os.chmod(args.output, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH)
file_size = len(ts_content) file_size = len(ts_content)
print(f"✅ TypeScript types generated: {args.output} ({file_size} characters)") print(f"✅ TypeScript types generated: {args.output} ({file_size} characters)")

View File

@ -403,6 +403,13 @@ async def create_candidate(
# Create candidate # Create candidate
candidate = Candidate.model_validate(candidate_data) candidate = Candidate.model_validate(candidate_data)
# Check if candidate already exists
existing_candidate = await database.get_candidate(candidate.id)
if existing_candidate:
return JSONResponse(
status_code=400,
content=create_error_response("ALREADY_EXISTS", "Candidate already exists")
)
await database.set_candidate(candidate.id, candidate.model_dump()) await database.set_candidate(candidate.id, candidate.model_dump())
# Add to users for auth (simplified) # Add to users for auth (simplified)