createArtist method
Creates a new artist
Implementation
Future<Artist> createArtist(
String artistName,
String email,
String password, {
bool enabled = true,
bool isReader = true,
bool isWriter = true,
bool isAdmin = false,
}) async {
final roles = <String>[];
if (isReader) {
roles.add('ROLE_READER');
}
if (isWriter) {
roles.add('ROLE_WRITER');
}
if (isAdmin) {
roles.add('ROLE_ADMIN');
}
final response = await _post('/api/artist', data: {
'artistName': artistName,
'email': email,
'enabled': enabled,
'password': password,
'roles': roles,
});
return Artist.fromJson(response.data);
}