feat: purchase-plans global update
This commit is contained in:
@@ -83,6 +83,7 @@ export default function PlacementDetailPage() {
|
||||
const [placement, setPlacement] = useState<Placement | null>(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [copiedLink, setCopiedLink] = useState(false);
|
||||
const [projectId, setProjectId] = useState<string | null>(null);
|
||||
|
||||
const canWrite = hasPermission("placements_write");
|
||||
|
||||
@@ -93,8 +94,14 @@ export default function PlacementDetailPage() {
|
||||
const loadPlacement = async () => {
|
||||
try {
|
||||
setLoading(true);
|
||||
// First, try to load placement without project_id (deprecated endpoint)
|
||||
// If that fails, we'd need projectId
|
||||
const data = await placementsApi.get(workspaceId, placementId);
|
||||
setPlacement(data);
|
||||
// Store projectId from placement for future operations
|
||||
if (data.project?.id) {
|
||||
setProjectId(data.project.id);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("Failed to load placement:", err);
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user