fix: return inserted_link on create
This commit is contained in:
+1
-1
@@ -33,7 +33,7 @@ WORKDIR /usr/src/app
|
|||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
libssl3 \
|
libssl3 \
|
||||||
libyaml-0-2 \
|
libyaml-0-2 \
|
||||||
libsqlite3-0 \
|
sqlite3 \
|
||||||
libevent-2.1-7 \
|
libevent-2.1-7 \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
|||||||
@@ -29,9 +29,9 @@ module App::Controllers
|
|||||||
raise App::UnprocessableEntityException.new(@env, map_changeset_errors(changeset.errors))
|
raise App::UnprocessableEntityException.new(@env, map_changeset_errors(changeset.errors))
|
||||||
end
|
end
|
||||||
|
|
||||||
link.clicks = [] of App::Models::Click
|
inserted_link = Database.get!(Link, changeset.instance.id)
|
||||||
|
|
||||||
render_json({"data" => App::Serializers::Link.new(link)}, 201)
|
render_json({"data" => App::Serializers::Link.new(inserted_link)}, 201)
|
||||||
end
|
end
|
||||||
|
|
||||||
def redirect
|
def redirect
|
||||||
|
|||||||
Reference in New Issue
Block a user