use of com.fastaccess.data.dao.CreateGistModel in project FastHub by k0shk0sh.
the class CreateGistPresenter method onSubmit.
@Override
public void onSubmit(@NonNull String description, @NonNull HashMap<String, FilesListModel> files, boolean isPublic) {
if (files.isEmpty())
return;
CreateGistModel createGistModel = new CreateGistModel();
createGistModel.setDescription(InputHelper.toString(description));
createGistModel.setPublicGist(isPublic);
createGistModel.setFiles(files);
onSubmit(createGistModel);
}
use of com.fastaccess.data.dao.CreateGistModel in project FastHub by k0shk0sh.
the class CreateGistPresenter method onSubmitUpdate.
@Override
public void onSubmitUpdate(@NonNull String id, @NonNull String description, @NonNull HashMap<String, FilesListModel> files) {
boolean isEmptyDesc = InputHelper.isEmpty(description);
if (getView() != null) {
getView().onDescriptionError(isEmptyDesc);
}
if (isEmptyDesc)
return;
CreateGistModel createGistModel = new CreateGistModel();
createGistModel.setDescription(InputHelper.toString(description));
createGistModel.setFiles(files);
makeRestCall(RestProvider.getGistService(isEnterprise()).editGist(createGistModel, id), gistsModel -> sendToView(view -> view.onSuccessSubmission(gistsModel)), false);
}
Aggregations