Compare commits
2 Commits
c8121cc5e7
...
R1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f3b243da2 | ||
|
|
59036e033b |
Binary file not shown.
@@ -390,6 +390,10 @@ paths:
|
|||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
format: binary
|
format: binary
|
||||||
|
'404':
|
||||||
|
description: Not Found or Unauthorized
|
||||||
|
'400':
|
||||||
|
description: Bad Request - Id not a positive integer
|
||||||
|
|
||||||
/api/materials:
|
/api/materials:
|
||||||
get:
|
get:
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ export async function deleteProjectFileHandler(req, res) {
|
|||||||
return res.status(404).json({ error: 'File not found or unauthorized' });
|
return res.status(404).json({ error: 'File not found or unauthorized' });
|
||||||
}
|
}
|
||||||
|
|
||||||
res.status(200).json({ message: 'File deleted successfully' });
|
res.status(204).json({ message: 'File deleted successfully' });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
res.status(400).json({ error: 'Invalid file ID' });
|
res.status(400).json({ error: 'Invalid file ID' });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -161,6 +161,13 @@ export async function getFilesByProjectId(projectId, userId) {
|
|||||||
|
|
||||||
const files = await prisma.file.findMany({
|
const files = await prisma.file.findMany({
|
||||||
where: { projectId },
|
where: { projectId },
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
projectId: true,
|
||||||
|
name: true,
|
||||||
|
size: true,
|
||||||
|
mimeType: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
return files;
|
return files;
|
||||||
|
|||||||
Reference in New Issue
Block a user