Exemple #1
0
def main_korisnici():
    if request.method == 'GET':
        korisnici = Korisnici.listaj()
        return jsonify({"korisnici": korisnici})
    elif request.method == 'POST':
        status, greske = Korisnici.dodaj(request.get_json())
        if status:
            return Response(status=201)
        else:
            r = Response(status=500)
            r.set_data(greske)
            return r
Exemple #2
0
def handleUsers():
    users = Korisnici.listaj()
    return jsonify({"data": users})