Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,28 @@ concurrency:
cancel-in-progress: true

jobs:
changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
rust: ${{ steps.filter.outputs.rust }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check for changes
uses: dorny/paths-filter@v2
id: filter
with:
filters: |
rust:
- '.cargo/**'
- '.github/**'
- 'crates/**'
- 'desktop/src-tauri/**'
- 'Cargo.toml'
- 'Cargo.lock'

typecheck:
name: Typecheck
runs-on: ubuntu-latest
Expand Down Expand Up @@ -38,6 +60,8 @@ jobs:
clippy:
name: Clippy
runs-on: macos-latest
needs: changes
if: needs.changes.outputs.rust == 'true'
permissions:
contents: read
steps:
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@ts-rest/core": "^3.52.1",
"@types/react-tooltip": "^4.2.4",
"cva": "npm:class-variance-authority@^0.7.0",
"effect": "^3.7.2",
"effect": "^3.17.7",
"mp4box": "^0.5.2",
"posthog-js": "^1.215.3",
"solid-js": "^1.9.3",
Expand Down
9 changes: 3 additions & 6 deletions apps/web/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Cap Web App
# `@cap/web`

More details, as well as a contributor guide, will be posted soon.

## Illustrations

A big thank you to Popsy (https://popsy.co) for some of the illustrations used in Cap.
Cap's NextJS web app for video sharing.
Used for both self hosting and on [cap.so](https://cap.so).
51 changes: 0 additions & 51 deletions apps/web/actions/folders/deleteFolder.ts

This file was deleted.

107 changes: 0 additions & 107 deletions apps/web/actions/folders/duplicateFolder.ts

This file was deleted.

37 changes: 0 additions & 37 deletions apps/web/actions/folders/getChildFolders.ts

This file was deleted.

30 changes: 0 additions & 30 deletions apps/web/actions/folders/getFolderBreadcrumb.ts

This file was deleted.

20 changes: 0 additions & 20 deletions apps/web/actions/folders/getFolderById.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { db } from "@cap/database";
import { organizations } from "@cap/database/schema";
import { eq } from "drizzle-orm";

export async function getOrganization(organizationId: string) {
export async function getOrganizationSSOData(organizationId: string) {
if (!organizationId) {
throw new Error("Organization ID is required");
}
Expand All @@ -18,7 +18,11 @@ export async function getOrganization(organizationId: string) {
.from(organizations)
.where(eq(organizations.id, organizationId));

if (!organization || !organization.workosOrganizationId || !organization.workosConnectionId) {
if (
!organization ||
!organization.workosOrganizationId ||
!organization.workosConnectionId
) {
throw new Error("Organization not found or SSO not configured");
}

Expand All @@ -27,4 +31,4 @@ export async function getOrganization(organizationId: string) {
connectionId: organization.workosConnectionId,
name: organization.name,
};
}
}
9 changes: 8 additions & 1 deletion apps/web/actions/organization/update-space.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { db } from "@cap/database";
import { getCurrentUser } from "@cap/database/auth/session";
import { spaces, spaceMembers } from "@cap/database/schema";
import { eq } from "drizzle-orm";
import { eq, and } from "drizzle-orm";
import { revalidatePath } from "next/cache";
import { uploadSpaceIcon } from "./upload-space-icon";
import { v4 as uuidv4 } from "uuid";
Expand All @@ -19,6 +19,13 @@ export async function updateSpace(formData: FormData) {
const members = formData.getAll("members[]") as string[];
const iconFile = formData.get("icon") as File | null;

const [membership] = await db()
.select()
.from(spaceMembers)
.where(and(eq(spaceMembers.spaceId, id), eq(spaceMembers.userId, user.id)));

if (!membership) return { success: false, error: "Unauthorized" };

// Update space name
await db().update(spaces).set({ name }).where(eq(spaces.id, id));

Expand Down
Loading
Loading