0 seguidores
0 seguidos
Al usar el botón para cambiar de vídeo con la flecha, desde el anterior, me manda a un 404
Holaaa
Si una función necesita varios parámetros, especialmente con valores por defecto u opcionales, usa un objeto como argumento en lugar de una lista de parámetros.
type AutenticacionParams = { jwt: string; userId?: string; role?: string; level?: number; };
const estaAutenticado = ({ jwt, userId = 'administrador', role = 'customer', level = 10, }: AutenticacionParams): AUTENTICADO => { return { userId, jwt, role, level }; };
👉 Al usar objeto:
const respuesta = estaAutenticado({ jwt: 'bmnb6867' }); // { userId: "administrador", jwt: "bmnb6867", role: "customer", level: 10 }
Así evitamos errores, saludos!!
Grande profe, muy buen curso, recursos y explicación
Wow, fascinado con este profesor. En general, los profes Mexicanos tienen mucho punch en esta plataforma. ¡Viva México!
¿Cómo que el vídeo no existe?
Creo que es insertion sort, no selection sort jejeje
Comparto mi Query, donde la aportación en la inserción a la tabla de Jobs de una manera diferente, ya tomando en cuenta el ID en Persons, esta forma de hacerlo es con un SELECT:
CREATE TABLE Persons (
id UUID DEFAULT gen_random_uuid() NOT NULL,
first_name VARCHAR(60) NOT NULL,
last_name VARCHAR(60) NOT NULL,
birthday DATE NOT NULL,
created_at TIMESTAMP DEFAULT now() NOT NULL,
updated_at TIMESTAMP,
CONSTRAINT persons_id_pk PRIMARY KEY (id),
CONSTRAINT persons_first_name_last_name_uk UNIQUE (first_name, last_name)
);
INSERT INTO Persons VALUES
(DEFAULT, 'Alexis', 'Lozada', '1990-02-08', DEFAULT, now()),
(DEFAULT, 'Luis Daniel', 'Olmos Gutiérrez', '2001-12-31', DEFAULT, now()),
(DEFAULT, 'Juan Alexis', 'Olmos Jiménez', '2000-11-12', DEFAULT, now());
CREATE TABLE Jobs (
id UUID DEFAULT gen_random_uuid() NOT NULL,
persons_id UUID NOT NULL,
job_name VARCHAR(50) NOT NULL,
created_at TIMESTAMP DEFAULT now() NOT NULL,
updated_at TIMESTAMP,
CONSTRAINT jobs_id_pk PRIMARY KEY (id),
CONSTRAINT jobs_persons_id_fk FOREIGN KEY (persons_id)
REFERENCES Persons (id)
ON UPDATE RESTRICT
ON DELETE RESTRICT
);
INSERT INTO Jobs (id, persons_id, job_name, created_at, updated_at)
VALUES
(DEFAULT, (SELECT id FROM Persons WHERE first_name = 'Alexis' AND last_name = 'Lozada'), 'Programador', DEFAULT, now()),
(DEFAULT, (SELECT id FROM Persons WHERE first_name = 'Luis Daniel' AND last_name = 'Olmos Gutiérrez'), 'Analista', DEFAULT, now()),
(DEFAULT, (SELECT id FROM Persons WHERE first_name = 'Juan Alexis' AND last_name = 'Olmos Jiménez'), 'Administrador', DEFAULT, now());
¡Saludos compañeros!
¿La base de datos relacional se vuelve no relacional cuando unicamente utilizamos el XML Type, y definimos el XML Schema?
Ya comenzamo en TikTok desde hace un año, pero con este curso aprendí nuevas estrategias y tips, demás que me refresco la memoria, mi cuenta es @matheando
En la tabla PEDIDO tenemos una relación 1:N Quiere decir que un SOLO cliente único puede realizar VARIOS pedidos únicos. En la tabla DETALLE_PEDIDO tenemos una relación N:M Quiere decir que VARIOS pedidos únicos pueden contener VARIOS productos únicos.