mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-08 21:15:18 +09:00
fix ts & PR comment
This commit is contained in:
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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user