fix ts & PR comment

This commit is contained in:
Sara Vieira committed 2022-07-16 18:10:42 +02:00
1 parent 0034899193
commit f45a6767db
3 files changed
+8 -8

No files matched your search

@@ -17,11 +17,7 @@ export const TabContent = ({ assets }: { assets: Array<Asset> }) => {
return (
<Flex gap="3" direction="column" css={{ padding: "$1" }}>
<Flex
css={{
justifyContent: "space-between",
}}
>
<Flex justify="between">
<Heading>Assets</Heading>
<Form method="post" encType="multipart/form-data">
<input
+2 -1
View File
@@ -60,7 +60,8 @@ export const action: ActionFunction = async ({ request, params }) => {
name: image.name,
path: `${path.join("/", folderInPublic, image.name)}`,
};
db.assets.create(params.id, data);
const projectId = params.id as string;
db.assets.create(projectId, data);
});
return {
+5 -2
View File
@@ -1,4 +1,4 @@
import { Asset, type Project } from "@webstudio-is/react-sdk";
import { type Project } from "@webstudio-is/react-sdk";
import { prisma } from "./prisma.server";
export const loadByProject = async (projectId?: Project["id"]) => {
@@ -13,7 +13,10 @@ export const loadByProject = async (projectId?: Project["id"]) => {
return assets;
};
export const create = async (projectId: Project["id"], values: Asset) => {
export const create = async (
projectId: Project["id"],
values: { type: string; name: string; path: string }
) => {
const newAsset = await prisma.asset.create({
data: {
...values,