Clone attachment to other piece
This commit is contained in:
@@ -169,12 +169,17 @@ export default Api.bundle({
|
||||
// --- Attachment CRUD ---
|
||||
|
||||
createAttachment: Api.make(
|
||||
Schema.Struct({
|
||||
pieceId: PieceId,
|
||||
filename: Schema.NonEmptyString,
|
||||
mediaType: Schema.NonEmptyString,
|
||||
data: Uint8ArrayArrayBufferFromSelf,
|
||||
}),
|
||||
pipe(
|
||||
Schema.Union(
|
||||
Schema.Struct({ data: Uint8ArrayArrayBufferFromSelf }),
|
||||
Schema.Struct({ sha256: Sha256 }),
|
||||
),
|
||||
Schema.extend(Schema.Struct({
|
||||
pieceId: PieceId,
|
||||
filename: Schema.NonEmptyString,
|
||||
mediaType: Schema.NonEmptyString,
|
||||
})),
|
||||
),
|
||||
Attachment,
|
||||
Schema.Union(Unauthenticated, Unauthorized, NotFound),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user