//
//  ALGroupEditViewModel.m
//  GMAlpha
//
//  Created by zhb on 2018/11/16.
//  Copyright © 2018 Gengmei. All rights reserved.
//

#import "ALGroupEditViewModel.h"

@implementation ALGroupEditViewModel
- (instancetype)init
{
    self = [super init];
    if (self) {
        _remoteUrl = API_V1_GROUP;
    }
    return self;
}

- (void)buildParams{
    _params = @{
                @"group_id": SafeNumber(@(self.groupId))
                };
}

- (void)buildModelWithRemoteDic:(NSDictionary *)dic{
    if ([dic[@"error"] integerValue] != 0) {
        return;
    }
    NSDictionary *dataDict = dic[@"data"];
    NSError *error = nil;
    self.contentObject = [[ALGroupEditObject alloc] initWithDictionary:dataDict error:&error];
}
@end
