* Checks if a workspace can create more tables based on its plan limits. * * @param workspaceId - The workspace ID to check * @param currentTableCount - The current number of tables in the workspace * @returns Object with canCreate boolean and limit info
( workspaceId: string, currentTableCount: number )
| 234 | * @returns Object with canCreate boolean and limit info |
| 235 | */ |
| 236 | async function canCreateTable( |
| 237 | workspaceId: string, |
| 238 | currentTableCount: number |
| 239 | ): Promise<{ canCreate: boolean; maxTables: number; currentCount: number }> { |
| 240 | const limits = await getWorkspaceTableLimits(workspaceId) |
| 241 | |
| 242 | return { |
| 243 | canCreate: currentTableCount < limits.maxTables, |
| 244 | maxTables: limits.maxTables, |
| 245 | currentCount: currentTableCount, |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | /** |
| 250 | * Gets the maximum rows allowed per table for a workspace based on its plan. |
nothing calls this directly
no test coverage detected