mirror of
https://github.com/Mercantec-GHC/h4-projekt-gruppe-0-sm.git
synced 2025-04-27 16:24:07 +02:00
add products to db
This commit is contained in:
parent
c8808392e4
commit
f799db5b32
@ -53,9 +53,21 @@ CREATE TABLE IF NOT EXISTS receipt_products (
|
||||
INSERT OR REPLACE INTO users (name, email, password_hash, balance_dkk_cent)
|
||||
VALUES ('User','test@email.com','08ce0220f6d63d85c3ac313e308f4fca35ecfb850baa8ddb924cfab98137b6b18b4a8e027067cb98802757df1337246a0f3aa25c44c2b788517a871086419dcf',10000);
|
||||
|
||||
INSERT OR REPLACE INTO products (name, price_dkk_cent, description, coord, barcode)
|
||||
VALUES ('Letmælk',1195,'Mælk fra ko',NULL,NULL);
|
||||
INSERT OR REPLACE INTO products (name, price_dkk_cent, description, coord, barcode) VALUES
|
||||
('Minimælk',1195,'Konventionel minimælk med fedtprocent på 0,4%',NULL,NULL),
|
||||
('Letmælk',1295,'Konventionel letmælk med fedtprocent på 1,5%',NULL,NULL),
|
||||
('Frilands Øko Supermælk',1995,'Økologisk mælk af frilandskøer med fedtprocent på 3,5%. Ikke homogeniseret eller pasteuriseret. Skaber store muskler og styrker knoglerne 💪',NULL,NULL),
|
||||
('Øko Gulerødder 1 kg',995,'',NULL,NULL),
|
||||
('Øko Agurk', 995, 'Øko Agurk fra gården', NULL, NULL),
|
||||
('Æbler 1 kg', 995, 'Friske danske æbler', NULL, NULL),
|
||||
('Basmati Ris', 1995, 'Løse og duftende ris', NULL, NULL),
|
||||
('Haribo Mix', 2995, 'Lækre Haribo slik', NULL, NULL),
|
||||
('Harboe Cola', 495, 'Sød og forfriskende cola', NULL, NULL),
|
||||
('Monster Energi Drik', 1495, '', NULL, '5060337502900'),
|
||||
('Amper Energi Drik', 595, '', NULL, '5712870659220'),
|
||||
('Danskvand Med Brus', 495, 'Med smag af blåbær', NULL, '5710326001937'),
|
||||
('Spaghetti', 995, 'Perfekt til pasta-retter', NULL, NULL),
|
||||
('Rød Cecil', 5995, 'Populære cigaretter', NULL, NULL),
|
||||
('Jägermeister 750 ml', 11995, 'Krydret urtelikør', NULL, NULL)
|
||||
|
||||
INSERT OR REPLACE INTO products (name, price_dkk_cent, description, coord, barcode)
|
||||
VALUES ('Smør',2000,'Smør fra mejeri',NULL,NULL);
|
||||
|
||||
|
@ -51,8 +51,8 @@ const Session* middleware_session(HttpCtx* ctx);
|
||||
#define RESPOND(HTTP_CTX, STATUS, MIME_TYPE, ...) \
|
||||
{ \
|
||||
HttpCtx* _ctx = (HTTP_CTX); \
|
||||
char _body[512]; \
|
||||
snprintf(_body, 512 - 1, __VA_ARGS__); \
|
||||
char _body[8192]; \
|
||||
snprintf(_body, 8192 - 1, __VA_ARGS__); \
|
||||
\
|
||||
char content_length[24] = { 0 }; \
|
||||
snprintf(content_length, 24 - 1, "%ld", strlen(_body)); \
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include "../models/models_json.h"
|
||||
#include "../util/str.h"
|
||||
#include "controllers.h"
|
||||
#include <stdio.h>
|
||||
|
||||
void route_get_products_all(HttpCtx* ctx)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user