Skip to content

Commit ea96c08

Browse files
committed
Attach id to response on get_paste.
1 parent ede7c75 commit ea96c08

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

app.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,12 @@ def get_paste(id):
9393
connection.close()
9494

9595
return jsonify({
96+
'id': str(id),
9697
'author': str(author),
97-
'text': text,
98-
'language': language,
99-
'type': type,
100-
'date': date
98+
'text': str(text),
99+
'language': str(language),
100+
'type': str(type),
101+
'date': str(date)
101102
})
102103

103104
@app.route('/v1/pastebin/all', methods = ['GET'])
@@ -117,10 +118,10 @@ def get_all_pastes():
117118
all_pastes.append({
118119
'id': str(id),
119120
'author': str(author),
120-
'text': text,
121-
'language': language,
122-
'type': type,
123-
'date': date
121+
'text': str(text),
122+
'language': str(language),
123+
'type': str(type),
124+
'date': str(date)
124125
})
125126

126127
return jsonify({

0 commit comments

Comments
 (0)