#include "bans.h"

#include "magic_strings.h"
#include <maps/libs/json/include/value.h>

namespace maps::wiki::aclsrv {

BanRequest::BanRequest(const std::string& str)
{
    auto json = json::Value::fromString(str);
    if (json.hasField(EXPIRES)) {
        expires = json[EXPIRES].toString();
    }
    if (json.hasField(REASON)) {
        reason = json[REASON].toString();
    }
}

} // namespace maps::wiki::aclsrv
