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
2 changes: 1 addition & 1 deletion studio/app/embeds/[embedId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ function EmbedPage({ params }: ProjectPageProps) {
);
}

export default withPageAuthRequired(withUserEnabled(EmbedPage));
export default EmbedPage;
6 changes: 1 addition & 5 deletions studio/features/embeds/queries/getEmbed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@ import { injectRepository } from "@features/db/helpers";
import { toPlain } from "@features/helpers/objects";

export default async function getEmbed(id: number) {
if (!(await canReadProjects())) throw new Error("Unauthorized");

const user = (await getUserToken())!;

const embedRepository = await injectRepository(Embed);

const embed = await embedRepository.findOne({
where: { id, project: { user: { id: user.id } } },
where: { id },
});

if (!embed) throw new Error("Not found");
Expand Down
6 changes: 1 addition & 5 deletions studio/features/embeds/queries/getEmbedFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,10 @@ import { injectRepository } from "@features/db/helpers";
import { listFilesInBucket } from "@features/storage";

export default async function getEnbedFile(id: number) {
if (!(await canReadProjects())) throw new Error("Unauthorized");

const user = (await getUserToken())!;

const embedRepository = await injectRepository(Embed);

const embed = await embedRepository.findOne({
where: { id, project: { user: { id: user.id } } },
where: { id },
});

if (!embed) throw new Error("Not found");
Expand Down