Documents
This commit is contained in:
parent
4eff0ed2e8
commit
a521f90f60
|
|
@ -54,13 +54,18 @@ class DocumentRepository {
|
||||||
return documentResponse.data.toList();
|
return documentResponse.data.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> upload(Credentials credentials, BaseEntity entity,
|
Future<bool> upload(
|
||||||
String filePath) async {
|
Credentials credentials, BaseEntity entity, String filePath) async {
|
||||||
final fields = <String, String>{};
|
final fields = <String, String>{
|
||||||
|
'_method': 'put',
|
||||||
|
};
|
||||||
|
|
||||||
await webClient.put(
|
await webClient.post(
|
||||||
'${credentials.url}/${entity.entityType.plural}/${entity.id}', credentials.token,
|
'${credentials.url}/${entity.entityType.plural}/${entity.id}',
|
||||||
data: fields, filePath: filePath, fileIndex: 'documents[]');
|
credentials.token,
|
||||||
|
data: fields,
|
||||||
|
filePath: filePath,
|
||||||
|
fileIndex: 'documents[]');
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue